New issue
Advanced search Search tips

Issue 896713 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Bug



Sign in to add a comment

Unexpected double injection using RequestContentScript

Reported by alexpign...@gmail.com, Oct 18

Issue description

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

Steps to reproduce the problem:
1. Put bg.js, inject.js, manifest.json in a directory
2. Load an Unpacked extension from chrome://extensions
3. Put test.html in a directory and start an HTTP server there (for example on port 8080)
4. Visit http://127.0.0.1:8080/test.html

What is the expected behavior?
On the dev tools console the line INJECT should appear only once

What went wrong?
The line INJECT appear twice

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 72.0.3580.0  Channel: n/a
OS Version: 
Flash Version: 

It is my understanding that an injected script should be executed only once in a given page. This test case shows that if another, independent, rule matches in page the injection happens twice.

In this case if there is a <p> element a SetIcon action is triggered. If there is no <p> in the page the SetIcon action does not trigger and the script is injected only once.
 
bg.js
599 bytes View Download
inject.js
23 bytes View Download
manifest.json
240 bytes View Download
test.html
146 bytes View Download
Components: Platform>Extensions
Status: Untriaged (was: Unconfirmed)
Cc: rdevlin....@chromium.org
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
declarativeContent.RequestContentScript is still experimental, and is likely to change in the future.  I'll mark this as available, since it should be fixed if it launches in this same form.

Sign in to add a comment