Error is thrown when assigning chrome.storage.local.set to the variable
Reported by
saroy...@gmail.com,
Sep 19
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3554.0 Safari/537.36
Steps to reproduce the problem:
1. Install the attached extension on Chrome Dev channel v71
2. Open the popup and inspect it
3. Observe
4. Install same extension in the Chrome Stable v69
5. Do 2-nd step
6. Observe
What is the expected behavior?
No error is thrown both on Chrome Stable V69 and Chrome Dev V71
What went wrong?
An error ` TypeError: Illegal invocation: Function must be called on an object of type StorageArea` is thrown on the operation below on Chrome Dev V71:
```
const setStorage = chrome.storage.local.set;
setStorage({"key": "value"});
```
Did this work before? Yes Chrome Stable v69, Chrome Dev V70 on MacOS
Does this work in other browsers? N/A
Chrome version: 71.0.3554.0 Channel: dev
OS Version: OS X 10.13.6
Flash Version:
On Chrome Dev 70 it's only reproducible on the Window Machine, but not on the MacOS.
Basically an extension was broken for some while apparently, it could have went unnoticeable, see -> https://github.com/Manvel/Privacy-Manager/issues/24
,
Sep 19
Using "--native-crx-bindings=1 --enable-features=NativeCrxBindings" command line, bisected to r441459 / f89894a0691ae2682427235ff5724a8cd46368ca "[Extensions Bindings] Make function definitions optional for an API." Simplified repro: install the attached extension Expected: 'SUCCESS' is shown Observed: 'FAIL' + error message is shown The bug can be circumvented by adding "--disable-features=NativeCrxBindings" to Chrome's command line.
,
Sep 19
Not a Blink Storage API, so changing components to extensions API.
,
Sep 19
,
Sep 20
Thanks for filing the issue! Able to reproduce the issue on reported chrome version 71.0.3554.0 and on the latest stable 69.0.3497.100 using Windows 10, Ubuntu 14.04 and Mac 10.13.1 when chrome is launched using "--native-crx-bindings=1 --enable-features=NativeCrxBindings" from command line. As the issue is seen from M60(60.0.3112.0) considering it as Non-Regression. Hence removing Needs-Bisect label. From comment#2 assigning it to jbroman for further inputs.
,
Sep 20
You can get it working using setstorage = chrome.storage.local.set.bind(chrome.storage.local)
,
Sep 20
Devlin is probably better equipped to triage.
,
Oct 3
This information is not much satisfactory. So, I would suggest this instructional exercise, we are making a Chrome extension that gives us a chance to spare site furthermore, it functions admirably with TypeScript, a composed super-arrangement of JavaScript. You can get more information through link https://www.windowstechnicalsupportnumbers.com/ Thank you!
,
Oct 3
Thanks for the report! This looks like a dupe of 821654. This works if you bind the method to the storage object, e.g.
const setStorage = chrome.storage.local.set.bind(chrome.storage.local);
This is more aligned with open web platform behavior as well, where calling methods exposed on objects without the object can frequently fail. e.g.,
const getCurrentPosition = navigator.geolocation.getCurrentPosition;
getCurrentPosition(() => {});
fails with an "invalid invocation" error.
,
Oct 3
I agree that `const setStorage = chrome.storage.local.set;` is a not a great practice in general. I use the wrapper now, but will probably update to use binding, looks more elegant. Thanks for fast feedbacks, highly appreciate that. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 Deleted