Crossrider : How to Uninstall browser extension - browser-extension

I created browser extension using crossrider code, we can install this extension in all 4 browsers(Chrome,IE,Firefox,Safari).After installation a icon will be displayed beside the url. If we click on that icon a popup will displayed which contains one button
1)delete/uninstall
so, what I have to do is If user click on "uninstall/delete" button then the extension will remove from the browser.How can I achieve this functionality using crossrider code.

To the best of my knowledge, extension removal by the extension itself is not supported by any browser regardless of which platform the extension is written with. So whilst the Crossrider platform tries to provide as much common functionality as possible, I'm afraid this feature is not available.
[Disclosure: I am a Crossrider employee]

Chrome extensions can remove themselves using chrome.management.uninstallSelf. This does not require any permissions.
Firefox add-ons are trusted at the same level as the browser, so it is technically possible to remove the add-on. I don't know the API from the top of my head, but you could look at the source code of the Addon Manager for inspiration.
Internet Explorer extensions are binary code. Depending on how they're implemented, they might be able to uninstall themself. If you've written a basic BHO that runs in Internet Explorer's (low-integrity) process, then you cannot fully uninstall the extension, because it cannot write to the registry, or remove files from C:\Program Files.
Safari: Extensions don't have any method to remove themselves.

Related

List of all the Firefox and Chrome extensions

Does anyone know how I can get to a list of all the extensions of Firefox and Chrome?
I do not want an addon what I can use to dump all of my extensions, I want all the available extensions for Firefox and for Chrome.
What data do I want, preferably the name of the application and the name of the developer.
I do not believe there is an organized list of all the extensions for either browsers since their extensions are as numerous as they are. So, the only answer I have is to check out their extension pages(see below).
Chrome: https://chrome.google.com/webstore/category/extensions
Firefox: https://addons.mozilla.org/en-US/firefox/extensions/?sort=featured

Firefox displays outdated information from MDN on newly self-hosted extension

Firefox displays outdated information from MDN on newly self-hosted extension
I'm trying to switch the Firefox extension I'm developing from being hosted on MDN/mozilla.org to being self-hosted. This involves adding an entry to install.rdf pointing to an update.rdf on my own server.
However, I am finding that if a given Firefox profile has ever had the older, hosted-on-MDN version installed in it, it will then continue to look up information from MDN instead of just using the information contained in the extension's install.rdf. This means that the information on the extension displayed in about:addons stays out of date.
Here is a detailed walkthrough:
Create a new Firefox profile.
Manually install newest version of the Firefox extension by dropping it into extensions/ and then confirming the install. This extension is self-hosted: it has a updateURL set in its install.rdf.
Go to about:addons and confirm that the information displayed about the plugin is the information from the extension's install.rdf. (Description, creator, etc.)
Uninstall the extension.
Install the old non-self-hosted version of the extension from MDN, via the add-ons manager interface.
Go to about:addons and confirm that the information displayed about the extension is information sourced from MDN. (Description, creator, etc.) Search all files that comprise this version of the extension to make sure that the information displayed is definitely not contained within it, and hence is sourced from MDN.
Uninstall this version of the extension.
Again install the new, self-hosted version of the extension by dropping it into extensions/ and confirming the install with Firefox.
Go to about:addons. Observe that the displayed information is still sourced from MDN, despite this being the self-hosted version. Specifically, the creator and description are sourced from MDN, while the icon is sourced from install.rdf.
Firefox appears to be caching information about the extension even when the extension has been uninstalled, and once a given extension has been seen to be hosted on MDN, it will continue getting information from MDN even if the extension is now self-hosted.
Is there some step of this I'm missing beyond setting a updateURL value in the extension's install.rdf? Is this a bug in Firefox? Is there a workaround?
By default, Firefox grabs information from AMO for your add-on and it overwrites the information in the install.rdf.
So if you've moved your add-on from AMO to self hosting, the information will still be retrieved.
To prevent that, you can set a preference:
pref("extensions.YOUR_ADDON_ID.getAddons.cache.enabled", false);
This will keep Firefox from getting info about your add-on from AMO.
It might not take effect immediately for you, but it should take effect within 24 hours.

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

Can a firefox extension enable/disable other extensions working?

I am working with firefox extensions. I want an option of enabling other extension in the options dialog box. this will depend on users choice.
Like for doing some work there are 3 extensions user has. I would like my extension to have an option of asking user which extension outta the three he wants to enable.
I guess all my extension would need to know is the preference settings of others.
Take a look at the following links.
https://developer.mozilla.org/en/Toolkit_API/FUEL
https://developer.mozilla.org/en/Toolkit_API/extIExtensions
https://developer.mozilla.org/en/Toolkit_API/extIExtension

Automating Firefox configuration settings

During web development work, I need to be able to quickly switch various config settings in Firefox. In particular I need to be able to:
1) Switch off cookies
2) Switch off javascript
3) Switch my user agent (I have the user-agent switcher add-on installed)
and then back again.
Instead of doing this manually, it would be great if i could add a "macro" button to my toolbar that I could simply click to toggle the three settings above.
Anyone know if this is possible?
Btw - Firefox Profiles doesn't really cut it. You can't dynamically switch profiles within a specific Firefox instance, which I need to be able to do.
Btw2 - I got excited when i saw Greasemonkey, Chicken Foot, but it looks like these can only automate browsing/DOM tasks, and not with firefox configuration settings.
Thanks Richard.
Because of your requirements, it'd probably best for you to make a simple add-on yourself. You could even have it add a button that goes back and forth between things.
You can disable cookies by setting the preference "network.cookie.cookieBehavior" to 2, you can turn off JavaScript by setting the preference "javascript.enabled" to false, and you can modify the user agent by changing the preference "general.useragent.extra.firefox".
To do these things, you'll need to use the preference API, which is documented here.
There are other add-ons that I think will get all the functionality you're looking for (albeit, not all in one tool).
https://addons.mozilla.org/en-US/firefox/addon/2497
https://addons.mozilla.org/en-US/firefox/addon/6527
https://addons.mozilla.org/en-US/firefox/addon/59
If you wanted to extend the functionality of any of these Add-ons, XPI files are just .zip files with a different extension. You can rename them and unpack them and find out how they do what they do, extending them, install your own customized version, etc.
The web-developer toolbar will do all the things you requested except switching the user-agent string, which can be accomplished through the UA switcher addon you already use. However it can't be macroed as far as I know, but it can be accomplished with a few mouse click.
Try iMacros.
From their site:
"Whatever you do with Firefox, iMacros can automate it."

Resources