Closed
Bug 1201389
Opened 10 years ago
Closed 8 years ago
pageMod is attaching content scripts to <script> nodes in the same window
Categories
(Add-on SDK Graveyard :: General, defect, P3)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: adolf_daniel, Unassigned)
Details
Attachments
(1 file)
|
957 bytes,
application/x-zip-compressed
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36
Steps to reproduce:
When I tried to use pageMod on certain pages (e.g. bing.com search result page) the content scripts are attached multiple times to the same window (on the <script> tags). I need to use "frame" in attachTo as I have to attach to all the frames. Though the page has one iframe (expected to created two workers), it created many worker objects.
Firefox version: 40.0.2
JPM version: 1.0.1
index.js
var pageMod = require("sdk/page-mod");
pageMod.PageMod({
attachTo: ["existing", "top", "frame"],
include: [/.*bing.*/],
contentScript: 'console.log(document.location.href)'
});
go to url https://www.bing.com/search?q=hello&pc=MOZI&form=MOZSBR
Attached a sample addon with the issue.
Actual results:
console log printed for 17 times
console.log: pagemode: https://www.bing.com/search?q=hello&pc=MOZI&form=MOZSBR
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20Identity%20Blue$BlueIdentityDropdownBootStrap/jc/afd2a963/04592351.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20Identity%20Blue$BlueIdentityHeader/jc/6874c2cd/37eb3cec.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20Identity%20SnrWindowsLiveConnectBootstrap/jc/8e462492/c76620da.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20shareWebResults_c.source/jc/14377375/0f4b3475.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20SegmentFilters%20Blue$GenericDropDown/jc/6f82fe75/a47e7de7.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20MMRichHover_c.source/jc/44cf79e1/359283a7.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20ImageRichHover_c.source/jc/7018766e/5c160ee7.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20MMRichHoverInst_c.source/jc/d894585a/02e15e50.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20Multimedia%20answerDenseIrpOnSerp/jc/31585425/280785e1.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20WebResult%20Blue$WebResultToolboxBlue/jc/fc67918e/bcf861d0.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20vthumb_c.source/jc/42774b66/f4c8c021.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20VideoRichHover2_c.source/jc/63e08fc3/b19df9b2.js
console.log: pagemode: https://www.bing.com/rms/rms%20serp%20VideoRichHover_c.source/jc/f2ea398c/a2fa1a3a.js
console.log: pagemode: https://www.bing.com/rms/rms%20answers%20Rewards%20RewardsNcHeaderBootstrapAjax/jc/20ed1c25/b5d3d123.js
console.log: pagemode: https://www.bing.com/rms/Framework/jc/67106a7d/b337e4a0.js?bu=rms+answers+BoxModel+config%2crules%24rulesBHead2%2ccore%2cmodules%24scroll%2cmodules%24resize%2cmodules%24state%2cmodules%24mutation%2cmodules%24error%2cmodules%24network%2cmodules%24cursor%2cmodules%24keyboard%2cmodules%24bot
console.log: pagemode: https://www.bing.com/secure/Passport.aspx?popup=1&ssl=1
Expected results:
console log should be printed for only two times as the page has the one main window and one iframe.
| Reporter | ||
Updated•10 years ago
|
OS: Unspecified → Windows 8.1
Priority: -- → P3
Hardware: Unspecified → x86
Comment 1•8 years ago
|
||
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•