How can I create a Firefox extension that changes the new tab page behavior? - firefox

I am completely new to Firefox extension development so please let me know if there is a more appropriate place to post this question.
I want to create an extension for Firefox similar to Momentum or Tabliss that redefines the new tab page. I have some html/css/js files that I can run on a local server that work as desired. But I'd like to create an extension so I can view this stuff when I make a new tab. I have tried extensions to point to a local file on new tab but these are no longer allowed by Firefox.
I don't want to host it as a website and have the new tab open to a url. I specifically want to create an extension like Momentum or Tabliss that completely changes the new tab page.
Are there any resources I should look at to figure out how to do this? What specifically allows an extension to change the new tab page behavior?
Thank you for any help

Related

loading simple iframe from extension firefox

I have created a webpage that runs a script that I would like to be able to open from a button on the Firefox taskbar like an extension. If this looks something like this addon layout wise that would be fine. I was hoping to open an iframe in which the page is loaded. Does an extension exist for this or is it possible to create this for personal use myself?
I'm completely new at building Firefox extensions.
Turned out to be pretty simple. You basically create a file like this and add it to the addons website which can be set to personal or public use. Done.

Opening a bar on top of the page with firefox sdk

I am making a firefox pluggin and I want to open a "topbar" on a few websites. Realy, it would be a few informations about the curent page a link back to my own website. What would be te best way to do that ?
My first idea was to use content script, but that seems to be a very bad practice. I also read about panels, here are my questions :
How can I add my pannel just under the adressbar ?
How can I only open in it on the website I need ?
thx.
Using content script is completely fine.
It is modern, simple, less-code, more compatible way
to add top-panel to some web pages.
Also, code of content script is not injected to the web page, it just uses the dom and context; page script has no access (if you do not provide it explicit) to content script.
The only possible disadvantage is that panel would not look like native part of the browser.
If I convienced you to use content script:
The module you really need in your plugin page-mod
Using Add-on Builder you make have your plugin in a day

Modify contents of Firefox download dialog from add-on kit

I'd like to be able to add an option to the download dialog that pops-up in Firefox when starting a file download. Is it possible to do so using the new add-on SDK or do I have to do it the old way?
edit: Obviously, if the new option is selected, I need a way to know it and execute code based on it.
That's something you would use XUL overlays for. I guess that the dialog you are talking about is chrome://mozapps/content/downloads/downloads.xul - the download manager. AFAIK doing this isn't possible with the Add-on SDK, it only provides the most common UI integration points. You could create a traditional extension however, it can overlay any dialog.
There is no existing module that will help you that I know of, so you would have to create one, or wait for one to be made by someone else. But the main idea to extending browser UI is simple, and goes like this:
When the addon is loaded, scan for open windows of the type that you wish to extend.
extend the open windows by adding xul elements and javascript to the page.
listen for newly opened windows, and test that they are the type that you are looking for once they open
extend newly opened windows while your addon is active
Clean up after yourself when windows close or when your addon is disabled/uninstalled.
The last step is the most important and never matter with old school extensions which were not restartless.
Some for the built-in modules that you can look at that do this are the widget module, the context menu module, and the hotkeys module, all of which you can find here.
I've made a couple myself which are the toolbar button module, the xulkeys module, the menuitems module, and a few others, all of which you can find here.
Recently I wrote an extension do the same things. A bootstrap extension, not using addon-sdk.
I already submit it on AMO, but wait for review
https://addons.mozilla.org/en-US/firefox/addon/download-dialog-tweak/
And the source code
https://github.com/muzuiget/download_dialog_tweak

Displaying a page in Firefox without opening a new tab

I'm writing an editor that is updating a WYSIWYG view in the browser. As this update can happen often i don't want to open the page in a new tab. Is there any way other then using the ugly way of emitting keystrokes to enter the Open URL command and entering the URL (I'm doing this right now, but it's buggy if the user interacts with the system in the meantime).
I tag this as firefox but comments on other browsers are welcome.
Script given below changes location without opening new tab. I think it would be helpful.
TYPE IN ADDRESS BAR:
javascript:window.location.href = "http://www.yahoo.com";

How do I write a custom start page for VS 2008?

I've looked around, and not found much documentation on this, so I thought I'd ask where all the experts hang out.
I would like to create a new start page, with bug tracking and source control interfaces, rather than the standard MSDN feed. I seem to remember that one can do more than just supply a different URL, but can actually implement a component to run as the start page, which needn't use web content. I may be wrong. Can anyone please give me some tips?
You can do is to create a DTE ToolWindow (read: Creating a ToolWindow hosting a .NET user control) and host your controls there, then its pretty easy to create an addin that will show the tool window as a document at runtime. (The same way that the start-up page looks)
Go to Tools > Options > Environment > Startup and put your RSS URL in the Start Page news channel field.
That should give you enough, but if you want to do more you can select open home page in the at startup dropdown and point it at a URL with the appropriate content. If you use an intranet with Windows authentication you could display user specific stuff.
This will be completely customizable in VS 2010. You'll be able to do anything you want to on the start page.

Resources