forked from mirrors/gecko-dev
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;
MozReview-Commit-ID: AzhtdwJwVNg
--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d
41 lines
1.2 KiB
HTML
41 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Bug 1238183</title>
|
|
</head>
|
|
<body>
|
|
<script type="application/javascript">
|
|
"use strict";
|
|
|
|
// if we have a query string, use it to set storages
|
|
if (window.location.search.length > 0) {
|
|
let context_name = window.location.search.substr(1);
|
|
localStorage.setItem("userContext", context_name);
|
|
sessionStorage.setItem("userContext", context_name);
|
|
|
|
let request = indexedDB.open("idb", 1);
|
|
|
|
request.onerror = function() {
|
|
throw new Error("error opening db connection");
|
|
};
|
|
|
|
request.onupgradeneeded = event => {
|
|
let db = event.target.result;
|
|
let store = db.createObjectStore("obj", { keyPath: "id" });
|
|
store.createIndex("userContext", "userContext", { unique: false });
|
|
};
|
|
|
|
request.onsuccess = event => {
|
|
let db = request.result;
|
|
let transaction = db.transaction(["obj"], "readwrite");
|
|
let store = transaction.objectStore("obj");
|
|
store.add({id: 1, userContext: context_name});
|
|
|
|
transaction.oncomplete = () => {
|
|
db.close();
|
|
};
|
|
};
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|