Skip to content

Instantly share code, notes, and snippets.

@Infocatcher
Infocatcher / downloads.json
Created February 18, 2014 07:22
Test for https://github.com/Infocatcher/Download_Panel_Tweaker/issues/5, place it into Firefox profile to receive "Error: too much recursion Source file: resource://gre/modules/commonjs/sdk/core/promise.js Line: 110"
{
"list": [
{
"source": "http://example.com",
"target": "D:\\foo.htm",
"startTime": "2020-01-01T00:00:00.000Z",
"succeeded": true,
"totalBytes": 666
},
{
@Infocatcher
Infocatcher / createDownloadStack.js
Created February 19, 2014 13:08
Call stack for last DownloadStore.prototype.load() -> Downloads.createDownload(), https://github.com/Infocatcher/Download_Panel_Tweaker/issues/5
before@resource://gre/modules/XPIProvider.jsm -> .../downloadPanelTweaker@infocatcher.xpi!/bootstrap.js:492
wrapper@chrome://downloadpaneltweaker/content/patcher.jsm:36
task_DS_load@resource://gre/modules/DownloadStore.jsm:120
TaskImpl_run@resource://gre/modules/Task.jsm:233
resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118
then@resource://gre/modules/commonjs/sdk/core/promise.js:43
then@resource://gre/modules/commonjs/sdk/core/promise.js:153
TaskImpl_handleResultValue@resource://gre/modules/Task.jsm:269
TaskImpl_run@resource://gre/modules/Task.jsm:235
resolve@resource://gre/modules/commonjs/sdk/core/promise.js:118
@Infocatcher
Infocatcher / redirector.js
Last active August 29, 2015 13:57
Redirector example for Gecko 20+
// https://gist.github.com/Infocatcher/9523286
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
// Redirector example for Gecko 20+
// (c) Infocatcher 2014 <https://github.com/Infocatcher>
Services.obs.addObserver(observer, "http-on-modify-request", false);
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=21354#21354
// http://infocatcher.ucoz.net/js/akelpad_scripts/winMergeTabs.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/winMergeTabs.js
// (c) Infocatcher 2013
// version 0.1.1.1 - 2013-08-07
// Compare contents of current and next selected tab using WinMerge (http://winmerge.org/)
// or any other compare tool
@Infocatcher
Infocatcher / timer.js
Last active August 29, 2015 13:58
SetTimer() lib for AkelPad (test version)
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=24559#24559
// http://infocatcher.ucoz.net/js/akelpad_scripts/Include/timer.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/Include/timer.js
// (c) Infocatcher 2014
// version 0.1.0 - 2014-04-06
// Helper functions for user32::SetTimer()
// Usage example:
/*
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=17271#17271
// http://infocatcher.ucoz.net/js/akelpad_scripts/tileTabs.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/tileTabs.js
// (c) Infocatcher 2012-2013
// version 0.1.2 - 2013-02-24
// Tile current tab with next selected:
// select first tab, call script and then select second tab.
// Required MDI window mode!
@Infocatcher
Infocatcher / userAgentSwitcherIcons.css
Created April 11, 2014 16:13
Icons for User Agent Switcher Firefox extension, example style for userChrome.css
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@-moz-document url("chrome://browser/content/browser.xul") {
/* User Agent Switcher */
menu[id^="useragentswitcher-"] {
-moz-binding: url("chrome://global/content/bindings/menu.xml#menu-iconic") !important;
}
menu[id^="useragentswitcher-"] > .menu-iconic-left {
-moz-appearance: menuimage !important;
@Infocatcher
Infocatcher / autoSaveSession.js
Created April 21, 2014 09:36
autoSaveSession.js for AkelPad (test version)
// http://akelpad.sourceforge.net/forum/viewtopic.php?p=24561#24561
// http://infocatcher.ucoz.net/js/akelpad_scripts/autoSaveSession.js
// https://github.com/Infocatcher/AkelPad_scripts/blob/master/autoSaveSession.js
// (c) Infocatcher 2012-2014
// version 0.2.0 - 2014-04-06
// Automatically saves current session after selection or scroll changes
// Required Sessions plugin!
@Infocatcher
Infocatcher / panel.js
Last active August 29, 2015 14:02
Panel example (not only) for Custom Buttons for Firefox
// https://gist.github.com/Infocatcher/979c6ac08f86554ab7af
(function() {
var uri = "https://addons.mozilla.org/";
var initialSize = 300;
var horizontal = true;
var before = true;
var inTab = true;
var textZoom = 1;
var fullZoom = 1;
@Infocatcher
Infocatcher / RegExpHighlightTest.js
Created June 4, 2014 16:05
Testcase for JavaScript syntax highlighting (regular expressions)
// Regular expressions
var r = /\//i;
var r = /[\/*]/img;
var r = /[a-z]{5}/;
var r = /[a-z]{1,5}/;
var r = /([a-z])+/;
var r = /([a-z]{1,5})+/;
var r = /f([a-z])/;
var r = /a(b)c(d)/;
if(/\*/.test(s));