Skip to content

Instantly share code, notes, and snippets.

Noitidart Noitidart

Block or report user

Report or block Noitidart

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Noitidart
Noitidart / bootstrap.js
Last active Jan 4, 2016
This is the source to bootstrap addon "Custom About Page Demo". It demonstrates how to create an about:**** url for the MDN document located here: https://developer.mozilla.org/en-US/docs/Custom_about:_URLs#For_Firefox_4_%28Second_Approach%29
View bootstrap.js
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr, manager: Cm} = Components;
var selfPath; //note: file system on windows uses \ (forward slash)) but firefox browser uses / (backward slash) //do not edit //the jar will have forward slashes but to navigate so if just want a file within the main folder its selfPath + fileName. but if want folder its selfPath + fileName + '\\'fileInFolder //so as u can see must use forward slashes to navigate folders
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://gre/modules/Services.jsm');
Cm.QueryInterface(Ci.nsIComponentRegistrar);
var AboutModuleUnloaders = [];
function AboutModule() {}
@Noitidart
Noitidart / _template-listenPageLoad-insertElements.xpi
Last active Jan 4, 2016
Demo on how to create ff-addon that listens to page loads and inserts a DIV element into it. This example inserts a blue div 200x200 pixels at top left if mozillazine is found in the address. This demo uses the nsIWindowMediatorListener and nsIWindowMediator method.
@Noitidart
Noitidart / bootstrap.js
Created Jan 29, 2014
Reseraching how to watch non-gBrowser'ed windows with window listener. Extension of: Demo on how to create ff-addon that listens to page loads and inserts a DIV element into it. This example inserts a blue div 200x200 pixels at top left if mozillazine is found in the address.
View bootstrap.js
const {interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
const locationToMatch = 'mozillazine';
function addDiv(theDoc) {
//Cu.reportError('addDiv');
if (!theDoc) {
Cu.reportError('no theDoc!')
//document not provided, it is undefined likely
return;
@Noitidart
Noitidart / bootstrap.js
Created Jan 30, 2014
Demo on how to create ff-addon that listens to page loads and inserts a DIV element into it. This example inserts a blue div 200x200 pixels at top left if mozillazine is found in the address. This demo uses an alternative method to window listeners, it uses the observer service and document-element-inserted, this watches chrome windows which do …
View bootstrap.js
const {interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
const locationToMatch = 'mozillazine';
function addDiv(theDoc) {
//Cu.reportError('addDiv');
if (!theDoc) {
Cu.reportError('no theDoc!')
//document not provided, it is undefined likely
return;
@Noitidart
Noitidart / bootstrap.js
Created Jan 31, 2014
Bootstrap addon demo. Shows how to add a sidebar to all browsing windows. More specifically, a sidebar which allows HTML content.
View bootstrap.js
const {interfaces: Ci, utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
@Noitidart
Noitidart / bootstrap.js
Created Feb 2, 2014
This bootstrap addon shows how to add a menu item to the content context menu.
View bootstrap.js
const {interfaces: Ci,utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
@Noitidart
Noitidart / bootstrap.js
Last active Aug 29, 2015 — forked from Noitidart/bootstrap.js
This bootstrap addon shows how to add a menu item to the content context menu. FORK: This fork is different in that it shows how to make that menu item hidden or shown based on if the user opens the popup from a link that contains 'mozilla' in its href.
View bootstrap.js
const {interfaces: Ci,utils: Cu} = Components;
Cu.import('resource://gre/modules/Services.jsm');
/*start - windowlistener*/
var windowListener = {
//DO NOT EDIT HERE
onOpenWindow: function (aXULWindow) {
// Wait for the window to finish loading
let aDOMWindow = aXULWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
aDOMWindow.addEventListener("load", function () {
@Noitidart
Noitidart / about.md
Last active Mar 1, 2017 — forked from U-D13/about.md
Adds a fully functional "Fork" button to your own Gist.
View about.md

Fork your own Gist

This is a script that adds a fully functional Fork button to your own Gist.

If a Fork button is already present in the page, this bookmarklet will set focus to it instead of adding another one.

The change is temporary and the button will disappear as soon as you navigate away from that Gist (clicking the Fork button does this for you as well). Meaning you will have to run the script every new page load.

Firefox

Copy the contents from bookmarklet.js, open Scracthpad (Ctrl+F4), paste it there. Back in browser, swwitch to tab with your Gist you want to fork. Back in Scratchpad, "Run" it. Save and/or bookmark the Scratchpad file for future use.

@Noitidart
Noitidart / gist:8906220
Last active Aug 29, 2015
manny42_firefoxExtensionTest_lib_main.js
View gist:8906220
const {Cc, Ci, Cu, components} = require('chrome');
Cu.import('resource://gre/modules/Services.jsm');
var utils = require("sdk/window/utils");
var tabs = require("sdk/tabs");
var self = require("sdk/self");
var data = self.data;
function createPanel() {
var winsize = tabs.activeTab.attach({
You can’t perform that action at this time.