Closed
Bug 947662
Opened 12 years ago
Closed 12 years ago
worker.tab property undefined
Categories
(Add-on SDK Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: marnick.leau, Unassigned)
Details
(Keywords: testcase, Whiteboard: [bugday-20131209])
Attachments
(1 file)
190.18 KB,
application/x-xpinstall
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20131201 Firefox/24.0 PaleMoon/24.2.1 (Nightly/Aurora)
Build ID: 20131201142455
Steps to reproduce:
1) create pageMod in SDK add-on
2) confirm attachment of worker using console.log entries and visible interaction with page
3) access worker.tab from main.js or the contentScriptFile
Sample code attached
Screen.js is my worker, line 22 is the first access to the property. Twist and turn the code whichever way you want, any attempt to read worker.tab throws the error.
Replacing tab.id on main.js:62 and screen.js:22 by 0, installing, going to a youtube page and clicking the toolbar button proves that the worker is attached to the tab.
Actual results:
Error: worker.tab is undefined
Expected results:
worker.tab returns the tab the worker is attached to
Reporter | ||
Updated•12 years ago
|
Summary: worker tab property undefined → worker.tab property undefined
![]() |
||
Updated•12 years ago
|
![]() |
||
Comment 1•12 years ago
|
||
Sounds like an sdk issue, no?
Component: DOM → General
Product: Core → Add-on SDK
Version: 24 Branch → unspecified
Reporter | ||
Comment 2•12 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #1)
> Sounds like an sdk issue, no?
It is... There are a few other bugs with it too. Are they worth reporting or is all the SDK code being developer so quickly it's all fixed before you can file a report?
![]() |
||
Comment 3•12 years ago
|
||
Please report sdk issues, yes!
Reporter | ||
Comment 4•12 years ago
|
||
I'ts possible that SDK 1.15 fixes this, but since the Addon Builder still doesn't have the new version selectable, I can't know about this bug or any of the others
Comment 5•12 years ago
|
||
Been digging into this a bit, made a streamlined test case: https://gist.github.com/jsantell/7918684
It looks like `worker.tab` is truthy, and works, but when attempting to log this, a stack from the deprecation message and Console.jsm prints, from tab helpers accessing the windows, which access private browsing permissions. Not sure if a similar issue.
console.error: test:
DEPRECATED: `browserWindow.isPrivateBrowsing` is deprecated, please consider using `require("sdk/private-browsing").isPrivate(browserWindow)` instead.
Traceback (most recent call last):
File "resource://extensions.modules.jid1-jq1s8vekukmpkw-at-jetpack.commonjs.path/sdk/deprecated/events.js", line 123, in _emit
return this._emitOnObject.apply(this, args);
File "resource://extensions.modules.jid1-jq1s8vekukmpkw-at-jetpack.commonjs.path/sdk/deprecated/events.js", line 153, in _emitOnObject
listener.apply(targetObj, params);
File "resource://jid1-jq1s8vekukmpkw-at-jetpack/test/lib/main.js", line 10, in mod<.onAttach
console.log(worker.tab);
File "resource://gre/modules/devtools/Console.jsm", line 471, in null
let data = args.map(function(arg) {
File "resource://gre/modules/devtools/Console.jsm", line 472, in null
return stringify(arg, true);
File "resource://gre/modules/devtools/Console.jsm", line 136, in stringify
json = JSON.stringify(aThing);
File "resource://extensions.modules.jid1-jq1s8vekukmpkw-at-jetpack.commonjs.path/sdk/windows/dom.js", line 30, in WindowDom<.isPrivateBrowsing
deprecateUsage('`browserWindow.isPrivateBrowsing` is deprecated, please ' +
File "resource://extensions.modules.jid1-jq1s8vekukmpkw-at-jetpack.commonjs.path/sdk/util/deprecate.js", line 18, in deprecateUsage
let stack = get().slice(2);
Flags: needinfo?(marnick.leau)
Updated•12 years ago
|
Flags: needinfo?(marnick.leau)
Reporter | ||
Comment 6•12 years ago
|
||
Well yeah, but like I said, did you use 1.15 or 1.14? If you only just made this and used 1.15, then I guess the update yesterday fixed it.
And the privateBrowsing warning is another one of those bugs I noticed in 1.14. I'm waiting for the Add-on Builder to update to 1.15 so I can take another look at it all too.
Add-on Builder will not be getting 1.15. Jeff can explain the plans for Builder better than I can.
Flags: needinfo?(jgriffiths)
Comment 8•12 years ago
|
||
I used the cfx build too from master branch, so beyond 1.15 -- I really doubt this has anything to do with cfx
Reporter | ||
Comment 9•12 years ago
|
||
I found the announcement about not packing the SDK into the XPIs, which makes a lot of sense and seems more correct technically. I'm all for that. But then, why does the Addon Builder still pack the old SDK anyway? Shouldn't that be disabled?
Or maybe I'll just take a look at developing and compiling it all locally... Can't imagine it's much harder than the builder if you have the right tools.
Reporter | ||
Comment 10•12 years ago
|
||
> Or maybe I'll just take a look at developing and compiling it all locally...
> Can't imagine it's much harder than the builder if you have the right tools.
Well I take that back. None of this, neither the SDK nor the console nor Mozillabuild, makes any sense to me... I mean, a Linux console tat assumes Linux paths to navigate a Windows filesystem? "CFX" not found despite being in the dev console and the instructions saying CFX will be remembered after CDing to a directory? No indication of the SDK version being used? Rejecting 1.14 addons on the addons site while 1.15 is a beta and not even in the builder?
This whole situation is getting pretty paradoxal
Comment 11•12 years ago
|
||
(In reply to marnick.leau from comment #9)
...
> Or maybe I'll just take a look at developing and compiling it all locally...
> Can't imagine it's much harder than the builder if you have the right tools.
SDK 1.15 is out now:
https://blog.mozilla.org/addons/2013/12/12/announcing-add-on-sdk-1-15/
I would really recommend you move forward by working locally; Builder unfortunately has no resources assigned to it and an uncertain future.
Flags: needinfo?(jgriffiths)
Reporter | ||
Comment 12•12 years ago
|
||
(In reply to Jeff Griffiths (:canuckistani) from comment #11)
> (In reply to marnick.leau from comment #9)
> ...
> > Or maybe I'll just take a look at developing and compiling it all locally...
> > Can't imagine it's much harder than the builder if you have the right tools.
>
> SDK 1.15 is out now:
>
> https://blog.mozilla.org/addons/2013/12/12/announcing-add-on-sdk-1-15/
>
> I would really recommend you move forward by working locally; Builder
> unfortunately has no resources assigned to it and an uncertain future.
Unfortunately, I've been trying that all day and can't get any of it to work. Is there an actual step by step guide on setting up the dev env (ie just the XPI compiler, I don't need anything else) for SDK add-ons? I've been reading around on https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/index.html#getting-started and it still neither makes sense nor works... :(
Comment 13•12 years ago
|
||
The installation docs are here:
https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/tutorials/installation.html
Reporter | ||
Comment 14•12 years ago
|
||
(In reply to Jeff Griffiths (:canuckistani) from comment #13)
> The installation docs are here:
>
> https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/
> tutorials/installation.html
That's one of those things that's not working for me so far
Reporter | ||
Comment 15•12 years ago
|
||
(In reply to marnick.leau from comment #14)
> (In reply to Jeff Griffiths (:canuckistani) from comment #13)
> > The installation docs are here:
> >
> > https://addons.mozilla.org/en-US/developers/docs/sdk/latest/dev-guide/
> > tutorials/installation.html
>
> That's one of those things that's not working for me so far
Never mind, I finally got it to work. Thanks
Reporter | ||
Updated•12 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•