mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827346 - indexedDB.open() silently fails in an Open Web App (OWA/mozApp). r=myk
This commit is contained in:
parent
47be8d8d34
commit
e27363e562
@ -84,7 +84,7 @@ WebappsRegistry.prototype = {
|
||||
}
|
||||
} catch(e) {
|
||||
throw new Components.Exception(
|
||||
"INVALID_URL: '" + aURL, Cr.NS_ERROR_FAILURE
|
||||
"INVALID_URL: '" + aURL + "'", Cr.NS_ERROR_FAILURE
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -24,19 +24,7 @@ WebappsHandler.init();
|
||||
|
||||
// On firstrun, set permissions to their default values.
|
||||
if (!Services.prefs.getBoolPref("webapprt.firstrun")) {
|
||||
Cu.import("resource://webapprt/modules/WebappRT.jsm");
|
||||
let uri = Services.io.newURI(WebappRT.config.app.origin, null, null);
|
||||
|
||||
// Set AppCache-related permissions.
|
||||
Services.perms.add(uri, "pin-app",
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
Services.perms.add(uri, "offline-app",
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
|
||||
Services.perms.add(uri, "indexedDB",
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
Services.perms.add(uri, "indexedDB-unlimited",
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||
// Once we support packaged apps, set their permissions here on firstrun.
|
||||
|
||||
// Now that we've set the appropriate permissions, twiddle the firstrun
|
||||
// flag so we don't try to do so again.
|
||||
|
@ -31,6 +31,15 @@ pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/
|
||||
|
||||
pref("full-screen-api.enabled", true);
|
||||
|
||||
// IndexedDB
|
||||
pref("dom.indexedDB.enabled", true);
|
||||
pref("indexedDB.feature.enabled", true);
|
||||
pref("dom.indexedDB.warningQuota", 50);
|
||||
|
||||
// Offline cache prefs
|
||||
pref("browser.offline-apps.notify", false);
|
||||
pref("browser.cache.offline.enable", true);
|
||||
pref("offline-apps.allow_by_default", true);
|
||||
|
||||
// Enable smooth scrolling
|
||||
pref("general.smoothScroll", true);
|
||||
|
@ -13,6 +13,7 @@ include $(DEPTH)/config/autoconf.mk
|
||||
MOCHITEST_FILES = \
|
||||
test.webapp \
|
||||
webapprt_sample.html \
|
||||
webapprt_indexeddb.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
38
webapprt/test/content/webapprt_indexeddb.html
Normal file
38
webapprt/test/content/webapprt_indexeddb.html
Normal file
@ -0,0 +1,38 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<!--
|
||||
This is a IndexedDB WebappRT content mochitest. Since its name is prefixed with
|
||||
webapprt_, this file is picked up by the Mochitest harness. It's just a plain
|
||||
mochitest that runs in the app browser within an app window.
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display">
|
||||
This is the IndexedDB WebappRT content mochitest.
|
||||
</p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test">
|
||||
<script>
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var request = indexedDB.open('test');
|
||||
request.onsuccess = function() {
|
||||
ok(true, "onsuccess should be called");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
request.onerror = function() {
|
||||
ok(false, "onerror shouldn't be called");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user