New issue
Advanced search Search tips

Issue 886910 link

Starred by 3 users

Issue metadata

Status: Duplicate
Merged: issue 821654
Owner:
Closed: Oct 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

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
 
chrome-ext-boilerplate.zip
67.4 KB Download

Comment 1 Deleted

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.
test-ext.zip
591 bytes Download
Components: -Blink>Storage Platform>Extensions>API
Not a Blink Storage API, so changing components to extensions API.
Labels: Needs-Triage-M71 Needs-Bisect
Cc: vamshi.kommuri@chromium.org
Labels: -Needs-Bisect -Type-Bug-Regression Triaged-ET Target-71 M-71 FoundIn-71 OS-Linux OS-Windows Type-Bug
Owner: jbroman@chromium.org
Status: Assigned (was: Unconfirmed)
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.
You can get it working using setstorage = chrome.storage.local.set.bind(chrome.storage.local)
Cc: jbroman@chromium.org
Owner: rdevlin....@chromium.org
Devlin is probably better equipped to triage.
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!
Mergedinto: 821654
Status: Duplicate (was: Assigned)
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.
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