Closed Bug 1228781 Opened 9 years ago Closed 6 years ago

window object is not the same on addons

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: tfeserver, Unassigned)

Details

Attachments

(1 file)

247 bytes, application/javascript
Details
Attached file 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.
Thats true, it doesnt exists on twitter.com, but i was talking about mobile.twitter.com
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 ?
Cool, it works! Thanks!

But shouldn't this object be available directly without using wrappedJSObject?
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: