How do I put a widget to the new tab?

Talk about add-ons and extension development.
Post Reply
AlexXsWx
Posts: 1
Joined: July 17th, 2013, 6:16 am

How do I put a widget to the new tab?

Post by AlexXsWx »

Just like topic says, I want to put a widget(s) on to new tab. The easiest way to do this, as it seems to me, is to make a local page with iframe src = "about:newtab" ( or "chrome://browser/content/newtab/newTab.xul" ) and my widget over it, and replace about:newtab with this page. However, there're real and possible problems:
Real:
* Neither about:newtab nor chrome://.../newTab.xul won't load in iframe ( unlike, about:home, for example. Why? )
* Getting this urls with XHR raises security errors. Is it possible to set the local page into exceptions list, such allowing it to do cross-domain requests?
Possible:
* Modifying about:newtab to display other page which has reference to about:newtab may cause recursion. I hope this can be fixed by using newTab.xul as reference in about:newtab, however, I'm not sure this will work.
* Putting about:newtab in to an iframe may cause links clicked in it to be loaded inside the iframe, what is undesired behaviour.

So what's really the easiest way to do this?
User avatar
DanRaisch
Moderator
Posts: 127187
Joined: September 23rd, 2004, 8:57 pm
Location: Somewhere on the right coast

Re: How do I put a widget to the new tab?

Post by DanRaisch »

Moving to Extension Development.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: How do I put a widget to the new tab?

Post by patrickjdempsey »

1. Remote XUL is disabled in Firefox for security reasons. It is not really advisable to direct users to re-enable this, nor is it advisable to build an extension that re-enables it.

2. Reusing about:newtab which already exists is going to create conflicts. The best way to do this is to build a local HTML site into the extension and use a chrome:// address to open it. Changing browser.newtab.url to your address will open your local HTML site when the newtab button is pressed.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
Post Reply