Chrome/Firefox: access source of an extension - macos

Do Chrome or Firefox make your extension's source code open to the host machine? And if yes where are the respective folder on Mac?

Yes, assuming some or all of your extension is written in an interpreted and un-obfuscated language. Plain Javascript is common for extensions in both browsers.
For any firefox extension, if you save the .xpi file instead of installing it, it is just a zip file and you can open it with any archive tool (e.g. 7zip or WinZip).
The same goes for the .crx files Chrome. As an test, I just downloaded and opened the .crx for Google Mail Checker Plus using 7zip, and it looks like this is entirely written in javascript and all the source can be read.
In either case, how much usable source code you can get from this depends on the language(s) that are used in the extension.
Google Chrome installs the extension into ~/Library/Application Support/Google/Chrome/Default/Extensions/<EXTENSION_ID>/ and registers it in its Preferences file (according to this).
As heb says, Firefox installs the extension to ~/Library/Application Support/Firefox/Profiles/PROFILE_ID/extensions/EXTENSION_ID/

For Firefox the path is:
/Users/YOUR_LOGIN/Library/Application Support/Firefox/Profiles/PROFILE_ID/extensions/EXTENSION_ID/

view online
View a Chrome/Firefox/Opera extension/addon’s source in browser (without downloading):
https://robwu.nl/crxviewer/
bookmarklets
bookmarklets usage
Click the bookmarklet when on an extension’s page in the Chrome Web Store, Firefox addon gallery or Opera addon gallery.
bookmarklets source code
load in same tab
javascript:location.href='https://robwu.nl/crxviewer/?crx='+location.href;
open in new tab
javascript:window.open('https://robwu.nl/crxviewer/?crx='+location.href,'_blank');
bookmarklets links
view extension source online (Chrome .crx) # https://robwu.nl/crxviewer/?crx= ← You can drag this link to your bookmark bar to create the bookmarklet, but you have to edit its URL afterwards: Delete everything before javascript, including the single slash: http://delete_me/
view extension source online in new tab (Chrome .crx) # https://robwu.nl/crxviewer/?crx=

I know it's an old topic but for future research.. it could be interesting..so following the link :
How to find extension code?
This article explains very well where are located extensions code for Firefox, Chrome (working on Chromium too of course) on Ubuntu and Windows!
Best,

Related

Locating Extension Source Code in Firefox

What folder in firefox is where the extension IDs or source code is located?
I want to query the content of this folder to determine what extensions are installed on the browser (with Tanium).
For example, in Chrome, you can find it in
%userprofile%\AppData\Local\Google\Chrome\User Data\Default\Extensions\

I can't save monkeygtd on firefox

The firefox's version is 38.0.
When I try to save the monkeygtd based on tiddlywiki, it reports below.
It's not possible to save changes. Possible reasons include:
- your browser doesn't support saving (Firefox, Internet Explorer, Safari and Opera all work if properly configured)
- the pathname to your TiddlyWiki file contains illegal characters
- the TiddlyWiki HTML file has been moved or renamed
Is there any specific setting on firefox?
I got the solution from there
https://www.mail-archive.com/gtd-tiddlywiki#googlegroups.com/msg01979.html
Paste here:
Open this web-page from Firefox: https://addons.mozilla.org/en-US/firefox/addon/tiddlyfox/?src=search
Install the TiddlyFox extension for Firefox
Re-start Firefox

Firefox - How to enable an HTML (with Javascript) file to save itself locally?

Firefox - How to enable an HTML file to save itself locally?
I use Firefox to open and edit TiddlyWiki.html files.
https://github.com/Jermolene/TiddlyWiki5
These are HTML with a Javascript app packaged together in one file.
They also have this Firefox extension called TiddlyFox that can enable the TiddlyWiki.html file to save itself locally in the file you just opened. It first asks if you want the this ability to be enabled on that particular file and if you click Yes it works.
I was wondering how this behavior is achieved via the Firefox Extension? (ex source code here: https://github.com/TiddlyWiki/TiddlyFox )
Google Chrome has the filesystem api, i dont know if this is how Tiddly does it but this topic solution shows how to do it in chrome:
http://stackoverflow.com/a/13779352/1828637
Noitidart comment Feb 10 '15 at 3:38

Hack Firefox to open extensions with address bar

I see this one time, and know that it not so hard, but can't find any solutions in internet.
Let say I have plugin, as you know it written by XUL. XUL like HTML has tags, js and etc. So I want to debug it with Firebug.
But in default plugin view firebug (as all other plugins disabled). So i need to open my plugin like Web page.
I remember that it's something like
chrome://address/to/my/plugin/page.xul
Does anyone face this problem?
There is no general rule by which you can build the addresses of extension pages. You have to open the extension's XPI file (it's a regular ZIP file, rename it if necessary) and have a look at chrome.manifest inside. E.g. in Firebug's chrome.manifest it says:
content firebug content/firebug/
Which means that the files in the content/firebug/ directory of the extension are accessible under chrome://firebug/content/. You can try opening them as web pages but they won't necessarily work.
A better approach would be using tools that are actually meant for extensions. For example Chromebug or DOM Inspector.

Firefox shows .gadget files in tab instead of downloading

I have a simple HTML file which references .gadget so that it can be downloaded:
Download me!
IE, Opera, Safari and Chrome all offer saving file to disk, however Firefox loads binary file in a tab. Why does Firefox hate me and what must I do to force Firefox to offer download dialog?
I don't really want to instruct users to "right-click and choose 'save file as'", or that they have to remove .zip extension after downloading.
Server is Apache/2.2.17, in case that it's relevant. Interesting fact is that Firefox does behave like all other browsers - if I load open .html file from local disk. But once it's on the server, it loads file in a tab.
So, here's the solution.
The problem is that Apache returns Content-Type=text/plain HTTP header by default for all "unknown" file types. Firefox adheres to the standards unlike all other browsers so it displays the content. Here's what they have to say about it. You can inspect header in Firefox with Firebug (or simply use curl if you're on Unix).
The above link also hints the solution; register application/x-windows-gadget MIME type with the server. If you don't have access to the server configuration, put .htaccess file in the same directory as your file (or in any of the directories above your directory) with the following line:
AddType application/x-windows-gadget .gadget
After that, don't forget to clear your browser cache.

Resources