Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Fix Chromium local store exception (#17557)
Browse files Browse the repository at this point in the history
At least on Chromium 73 when opening the extension options window an
exception
"TypeError: Illegal invocation: Function must be called on an object of type StorageArea"
is thrown, which results in empty update channels page.

It looks like chrome.storage.local methods need to be called while bound to
the chrome.storage.local object.

According to
KeithHenry/chromeExtensionAsync#10
wtetsu/mouse-dictionary#16 this Chromium change
has been introduced probably around version 70 or 72.

Automatic ruleset updates might have been affected by this, too.
  • Loading branch information
maciejsszmigiero authored and zoracon committed Apr 11, 2019
1 parent 72c1480 commit 146032c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chromium/background-scripts/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ async function performMigrations() {
}

const local = {
get: chrome.storage.local.get,
set: chrome.storage.local.set,
remove: chrome.storage.local.remove,
get: (...args) => chrome.storage.local.get(...args),
set: (...args) => chrome.storage.local.set(...args),
remove: (...args) => chrome.storage.local.remove(...args),
get_promise: local_get_promise,
set_promise: local_set_promise
};
Expand Down

0 comments on commit 146032c

Please sign in to comment.