Closed
Bug 888262
Opened 11 years ago
Closed 11 years ago
page-mod does not attach to window/utils open()
Categories
(Add-on SDK Graveyard :: General, defect)
Add-on SDK Graveyard
General
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: thomas, Unassigned)
Details
Attachments
(1 file)
1.43 KB,
application/octet-stream
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release) Build ID: 2013051000 Steps to reproduce: See attached example: - create page-mod for a page of the addon e.g. "popup.html" - use window/utils -> open(data.url('popup.html')); Actual results: - content script is not attached to popup.html Expected results: Try same example with require('sdk/windows').browserWindows.open() -> content script gets attached
Reporter | ||
Comment 1•11 years ago
|
||
Here also the coding: 1. with sdk/windows: var data = require('sdk/self').data; var windows = require('sdk/windows').browserWindows; var pageMod = require("sdk/page-mod"); pageMod.PageMod({ include: data.url('popup.html'), contentScript: 'console.log("cs injected")', contentScriptWhen: 'start' }); windows.open({url: data.url('popup.html')}); -> result: "cs injected" logged to console 2. with sdk/window/utils var data = require('sdk/self').data; var {open} = require('sdk/window/utils'); var pageMod = require("sdk/page-mod"); pageMod.PageMod({ include: data.url('popup.html'), contentScript: 'console.log("cs injected")', contentScriptWhen: 'start' }); open(data.url('popup.html')); -> result: nothing logged to console
Comment 2•11 years ago
|
||
Use a tab, this is intentional, and soon the `use window/utils -> open(data.url('popup.html'));` steo will be disabled, see bug 840314
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Comment 3•11 years ago
|
||
s/steo/step(In reply to Erik Vold [:erikvold] [:ztatic] from comment #2) > Use a tab, this is intentional, and soon the `use window/utils -> > open(data.url('popup.html'));` steo will be disabled, see bug 840314 s/steo/step
Reporter | ||
Comment 4•11 years ago
|
||
I want to open a password dialog in a new browser window. With tabs.open({url: data.url(url),inNewWindow: true}) I'm not able to pass any features like width, location, menubar, modal etc. Is there a way to achieve this with the Addon SDK?
Comment 5•11 years ago
|
||
(In reply to toberndo from comment #4) > I want to open a password dialog in a new browser window. > > With tabs.open({url: data.url(url),inNewWindow: true}) I'm not able to pass > any features like width, location, menubar, modal etc. > > Is there a way to achieve this with the Addon SDK? the password manager is a chrome: uri so you should use `require('sdk/window/utils').open()` to open that, but page-mods do not work on these top level windows, so you'd have to use require('sdk/deprecated/window-utils').WindowTracker` for to make mods to the page.
Comment 6•11 years ago
|
||
(In reply to toberndo from comment #4) > I want to open a password dialog in a new browser window. > > With tabs.open({url: data.url(url),inNewWindow: true}) I'm not able to pass > any features like width, location, menubar, modal etc. > > Is there a way to achieve this with the Addon SDK? Also it's better to ask these questions in the google group https://groups.google.com/forum/#!forum/mozilla-labs-jetpack otherwise they may not be answered, and you may not get the best answer.
You need to log in
before you can comment on or make changes to this bug.
Description
•