mirror of https://github.com/gorhill/uBlock.git
Use browser.storage.local API for Firefox + private mode
But only if the indexedDB is being created. Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2725
This commit is contained in:
parent
872eafa378
commit
5739562d10
|
@ -19,7 +19,7 @@
|
||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* global IDBDatabase, indexedDB */
|
/* global browser, IDBDatabase, indexedDB */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -179,6 +179,15 @@ const selectIDB = async function() {
|
||||||
return resolve(null);
|
return resolve(null);
|
||||||
}
|
}
|
||||||
req.onupgradeneeded = function(ev) {
|
req.onupgradeneeded = function(ev) {
|
||||||
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/2725
|
||||||
|
// If context Firefox + incognito mode, fall back to
|
||||||
|
// browser.storage.local for cache storage purpose.
|
||||||
|
if (
|
||||||
|
vAPI.webextFlavor.soup.has('firefox') &&
|
||||||
|
browser.extension.inIncognitoContext === true
|
||||||
|
) {
|
||||||
|
return req.onerror();
|
||||||
|
}
|
||||||
if ( ev.oldVersion === 1 ) { return; }
|
if ( ev.oldVersion === 1 ) { return; }
|
||||||
try {
|
try {
|
||||||
const db = ev.target.result;
|
const db = ev.target.result;
|
||||||
|
|
Loading…
Reference in New Issue