This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uris = { | |
"http://example.com/": true, | |
"https://example.com/": true, | |
"https://example.com/foo/bar.php?key=val&key2=val2#hash": true, | |
"file:///": true, | |
"ftp://example.com": true, | |
//"about:": true, // Removed in new versions | |
"about:newtab": true, | |
"about:config": true, | |
"about:cache?device=memory": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Turn off extensions signatures in Firefox | |
// Use at your own risk! | |
// Usage: | |
// Start browser with rights to write into his install directory (run as administrator) | |
// devtools.chrome.enabled = true (in about:config) | |
// Open Scratchpad: Shift+F4 (Tools - Web-Developer - Scratchpad) | |
// Set: Environment - Browser | |
// Then paste following code and press Run, browser will be restarted, than enjoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getDownloadHistory() { | |
var query = PlacesUtils.history.getNewQuery(); | |
query.setTransitions([Components.interfaces.nsINavHistoryService.TRANSITION_DOWNLOAD], 1); | |
var options = PlacesUtils.history.getNewQueryOptions(); | |
options.resultType = options.RESULTS_AS_URI; | |
options.queryType = Components.interfaces.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY; | |
options.includeHidden = true; | |
var result = PlacesUtils.history.executeQuery(query, options); | |
var contents = result.root; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getVKChar(vk) { | |
// Firefox doesn't have string representation for some codes... | |
// https://developer.mozilla.org/en-US/docs/DOM/KeyboardEvent#Virtual_key_codes | |
if(/^VK_(?:NUMPAD)?([\d+A-Z])$/.test(vk)) | |
return RegExp.$1; | |
switch(vk) { | |
case "VK_SPACE": return " "; //32 | |
case "VK_COLON": return ":"; //58 | |
case "VK_SEMICOLON": return ";"; //59 | |
case "VK_LESS_THAN": return "<"; //60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name about:blank?UserScripts/test | |
// @namespace dev/null | |
// @include about:blank?UserScripts/test | |
// @run-at document-start | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
console.log("test: " + document.readyState); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/Infocatcher/2d001a8c72eb278c3686 | |
// Based on code from Custom Buttons extension | |
// https://addons.mozilla.org/files/browse/261190/file/components/CustomButtonsService.js#L210 | |
function ImageConverter(imageURL, feedback) { | |
this.imageURL = imageURL; | |
this.feedback = feedback; | |
this.bytes = []; | |
this.channel = Services.io.newChannel(imageURL, null, null); | |
this.channel.notificationCallbacks = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<bindings xmlns="http://www.mozilla.org/xbl" | |
xmlns:html="http://www.w3.org/1999/xhtml" | |
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" | |
xmlns:xbl="http://www.mozilla.org/xbl"> | |
<binding id="urlbar" extends="chrome://browser/content/urlbarBindings.xml#urlbar"> | |
<content sizetopopup="pref"> | |
<xul:hbox class="autocomplete-textbox-container urlbar-textbox-container" flex="1"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Windows watcher, based on code from | |
// https://github.com/Infocatcher/Custom_Buttons/tree/master/CB_Editor_Toggle_on_Top | |
const watcherId = "customButtonsWindowsWatcher_" + this.id; | |
var {Application, Components} = window; // Prevent garbage collection in Firefox 3.6 and older | |
var watcher = Application.storage.get(watcherId, null); | |
if(!watcher) { | |
watcher = { | |
REASON_STARTUP: 1, | |
REASON_SHUTDOWN: 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on code from TabLang extension: https://addons.mozilla.org/addon/tablang/ | |
// and Master Password+ extension https://addons.mozilla.org/addon/master-password/ | |
var kb = { | |
GetKeyboardLayout: null, | |
GetLocaleInfoW: null, | |
init: function() | |
{ | |
this.init = function() {}; | |
Components.utils.import("resource://gre/modules/ctypes.jsm", this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var textZoom = 1.5; | |
var fullZoom = 1; | |
var scrollX = 0; | |
var scrollY = 200; | |
var tab = gBrowser.addTab("https://addons.mozilla.org/"); | |
var browser = tab.linkedBrowser; | |
if(scrollX || scrollY) { | |
var scrollTimer = setInterval(function() { |
NewerOlder