Hack Firefox to open extensions with address bar - firefox

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.

Related

Is there software I can use to view my Markdown files as a wiki, with relative links, on Windows

Our team has installed the Markdown Mode extension in Visual Studio on our Windows PCs, and we're happy with that as an editor for Markdown files, but we need a way to generate a wiki from those files where we can click on links that cross-link the files of the wiki. I've been trying to find something, but haven't had any success getting something running.
I tried creating an empty web application and pasting in the html file from here http://dynalon.github.io/mdwiki/#!index.md and naming it index.html, and adding a couple of md files to the same directory that I set to always copy to the build directory, but I got 404-3 errors when it tried to access the .md file.
I see a couple of tools that look possibly good but need Python or Ruby installed, which isn't ideal: http://markdoc.org/quickstart or http://helloform.com/projects/commonplace/
I see this ASP.NET control for embedding a Markdown file into a page http://wikicontrol.codeplex.com/ but the control is for VS 2010 so clearly is not being actively maintained, plus to use it I'll need to build something to take the relative links and find the related .md files and load them up in MVC - sounds like a hassle to get working, and it will require me to put MVC in my docs project.
Is there something that is just designed so that I can put an html file or similar in a directory with a root .md file and have it just immediately act like a wiki and allow navigation between them?
We have decided to use MarkdownDeep NuGet package and a single MVC controller to handle this. The MVC controller looks at the requested path, uses it to figure out the location of the Markdown file, reads that file and renders it to HTML and returns the HTML.

Chrome/Firefox: access source of an extension

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,

How can I beautify JavaScript and CSS in Firefox / Firebug?

Is there a way to beautify JavaScript and CSS in Firebug?
I'd like to be able to view formatted JavaScript code instead of the compressed version :).
There is now a plugin that intercepts JavaScript downloads and deminifies it at that point.
Unfortunately, the way it hooks into Firefox means that it applies to all JavaScript downloads and just not specific ones and the JavaScript files have to be served with an appropriate MIME type.
https://addons.mozilla.org/en-US/firefox/addon/247565/
CSS is already beautified in Firebug, as clearly seen by comparing the CSS tab or CSS pane with the raw source.
JavaScript, alas, is not. The best you can do, for now, is to paste the code into something like http://jsbeautifier.org/ .
However, if you write a Firebug extension that does this, you will have all of our gratitude. ;-)
Firefox Developer Tools has:
"Prettify Source" button: braces {} icon on bottom left
"Auto Prettify Minified Sources" setting: turns Prettify Source on by default.
To enable it: go to the engine icon on top right of the Debugger tab, not the global settings engine.
Tested on Firefox 42.

Load an image from Firefox cache?

I'm trying to load an image from the Firefox cache as the title suggests. I'm running Ubuntu, so the location of my cache is /home/me/.mozilla/firefox/xxxxxx.default/Cache
However, in the Cache (and this is on Mac, too) the filenames are just ridiculous combinations of letters and numbers. Is there a way to pinpoint a certain file?
You should take a look at the source code of the CacheViewer Add-on.
Download the file instead of installing it (right click and save as) and then extract it (it's just a Zip file, even though it has a .xpi extension), then extract the cacheviewer.jar file inside the resulting chrome folder. Finally go into content and then cacheviewer to find the javascript and XUL files.
From my brief investigation, the useful routines are in the cacheviewer.js file, though if you were hoping there would be a simple javascript one liner for accessing cached items you're probably going to be disappointed. The XUL files (which are just XML) are helpful in working out which JS functions are called to perform particular tasks. I'm not too sure how all this maps into Greasemonkey, rather than the extension environment, but hopefully there's enough code to get you started.
Ummm, that really is an internal implementation detail. But I suggest looking at how about:cache?device=disk and about:cache-entry?client=HTTP&sb=1&key=https://stackoverflow.com/Content/img/wmd/blockquote.png are implemented.
Also, http://www.securityfocus.com/infocus/1832 gives details, too. Note that Firefox doesn't use a separate file for everything...
And of course, Firefox may change the format at any time.
Just give your img src= attribute the full URL. If the image happens to be cacheable (the server sends an appropriate Expires: or Cache-control: header, for example) and it's already in the cache, Firefox will not hit the network.
HTTP caching is supposed to be invisible. When you're generating content, you generally shouldn't worry about it.
You can point REDbot at a URL to see all sorts of delicious information about its cacheability.

Can I use CSS in directory listing of Firefox?

For example if I put "C:\docs" in address bar of Firefox, it shows all files in the directory. Is it possible to customize this page with CSS?
Apache 2.2 allows us to do it using IndexStyleSheet directive, so I wondered if Firefox can do it.
Firefox has a file userContent.css for each profile (found in the profile's settings folder). That file defines the standard CSS, why may then be overwritten by a website. So they also apply to directory listings.
You should have a look at the actual HTML code Firefox is creating for the directory listing to see how to do the CSS definitions right. You will find extensive documentation about userContent.css on the web.
http://www.mozilla.org/unix/customizing.html#userContent
I think the easiest way is to create an own skin which custom css. You have to modify dirListing.css in this case. (chrome://global/skin/dirListing/dirListing.css)
I know the walnut theme (https://addons.mozilla.org/en-US/firefox/addon/122) includes a modified file listing.

Resources