All users were logged out of Bugzilla on October 13th, 2018

window object is not the same on addons

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
3 years ago
8 months ago

People

(Reporter: tfeserver, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

247 bytes, application/javascript
Details
(Reporter)

Description

3 years ago
Created attachment 8693258 [details]
main.js

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20151127004007

Steps to reproduce:

I created a simple addon for the webpage https://mobile.twitter.com.
I run the main.js file.


Actual results:

It doesn't provide me the window.TWITTER object of the app.
window.TWITTER is undefined.




Expected results:

window.TWITTER should have the value of the app, as told on the doc:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Add-ons/Developing_Firefox_OS_add-ons#The_window_object
On a regular desktop Firefox, `window.TWITTER` is undefined when inspecting twitter.com so I'm not sure why you expect this object to exist.
(Reporter)

Comment 2

3 years ago
Thats true, it doesnt exists on twitter.com, but i was talking about mobile.twitter.com
(Reporter)

Comment 3

3 years ago
Looks like they have two different sites without the same javascript
(In reply to tfe from comment #0)
> Created attachment 8693258 [details]
> main.js
> 
> User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:44.0) Gecko/20100101
> Firefox/44.0
> Build ID: 20151127004007
> 
> Steps to reproduce:
> 
> I created a simple addon for the webpage https://mobile.twitter.com.
> I run the main.js file.
> 
> 
> Actual results:
> 
> It doesn't provide me the window.TWITTER object of the app.
> window.TWITTER is undefined.
> 
> 
> 
> 
> Expected results:
> 
> window.TWITTER 

Have you tried window.wrappedJSObject.TWITTER ?
(Reporter)

Comment 5

3 years ago
Cool, it works! Thanks!

But shouldn't this object be available directly without using wrappedJSObject?

Comment 6

8 months ago
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.