New issue
Advanced search Search tips

Issue 673713 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Inaccurate check if object is an array in extensions::event_bindings

Reported by a.v.iats...@gmail.com, Dec 13 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce the problem:
1. (In an extension) Add a function to the background page that calls chrome.webNavigation.onDOMContentLoaded.addListener() with the url parameter set to the argument passed to the function
2. Add something that calls the background page function with an array of urls

What is the expected behavior?
Replace this check
---    if (filters.url && !(filters.url instanceof Array))
to this one
+++    if (filters.url && !(Array.isArray(filters.url))

What went wrong?
The check `!(filters.url instanceof Array)` inside EventImpl.prototype.addListener() method works correctly only if `filters.url` is an array created by that page's original Array constructor.

WebStore page: 

Did this work before? N/A 

Chrome version: 55.0.2883.87  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 24.0 r0

I've created an example extension to help in locating the issue.
 
test.zip
1.4 KB Download
Cc: pbomm...@chromium.org rdevlin....@chromium.org
Labels: M-55
Labels: prestable-55.0.2883.87
Cc: -rdevlin....@chromium.org
Owner: rdevlin....@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report!  In the somewhat-near term we're hoping to move away from the js custom bindings we have today, but this is easy enough to fix that it makes sense to do in the meantime.

Sign in to add a comment