Skip to content

Instantly share code, notes, and snippets.

View meandavejustice's full-sized avatar

Dave Justice meandavejustice

View GitHub Profile
loadIntoWindow: function (aDOMWindow) {
if (!aDOMWindow) return;
aDOMWindow.addEventListener('contextmenu', ev => {
console.log('gContextMenu', ev.mCurrentBrowser.ownerGlobal.gContextMenu);
console.log('oncontextmenu', ev, ev.mCurrentBrowser.ownerGlobal.gContextMenu.target);
contextMenuOptions(aDOMWindow);
});
// aDOMWindow.document.oncontextmenu = function(ev) {
// console.log('oncontextmenu', ev);
// contextMenuOptions(aDOMWindow);
loadIntoWindow: function (aDOMWindow) {
if (!aDOMWindow) return;
const contentAreaContextMenu = aDOMWindow.document.getElementById('contentAreaContextMenu');
if (contentAreaContextMenu) {
const menu = aDOMWindow.document.createElement('menu');
menu.setAttribute('label', 'Min Vid');
menu.setAttribute('id', 'myMenu');
// item one in submenu
const playMenuItem = aDOMWindow.document.createElement('menuitem');
loadIntoWindow: function (aDOMWindow) {
if (!aDOMWindow) return;
const contentAreaContextMenu = aDOMWindow.document.getElementById('contentAreaContextMenu');
if (contentAreaContextMenu) {
const menu = aDOMWindow.document.createElement('menu');
menu.setAttribute('label', 'Min Vid');
menu.setAttribute('id', 'myMenu');
const menuPopup = aDOMWindow.document.createElement('menu');
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.googleapis.com/youtube/v3/videos??key=AIzaSyCfy3cdlDMB9cEVwuHiGACnUjbc9G0gXTc&id=bnDTTffIGpI&part=snippet,contentDetails,status. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
@meandavejustice
meandavejustice / gist:d5eeb525ed4b69830d3cdfb3c114db88
Created May 22, 2017 18:53
Not enough arguments [nsIObserverService.addObserver]
"@undefined:75:NaN@resource://min-vid/lib/window-utils.js:75:1@resource://min-vid/lib/launch-video.js:8:21@resource://min-vid/index.js:24:21run@resource://gre/modules/commonjs/sdk/addon/runner.js:147:19startup/</<@resource://gre/modules/commonjs/sdk/addon/runner.js:87:9process@resource://gre/modules/Promise-backend.js:922:23walkerLoop@resource://gre/modules/Promise-backend.js:806:7Promise*scheduleWalkerLoop@resource://gre/modules/Promise-backend.js:739:11schedulePromise@resource://gre/modules/Promise-backend.js:770:7completePromise@resource://gre/modules/Promise-backend.js:707:7@resource://gre/modules/commonjs/sdk/addon/window.js:55:3EventListener.handleEvent*@resource://gre/modules/commonjs/sdk/addon/window.js:54:1startup/<@resource://gre/modules/commonjs/sdk/addon/runner.js:72:21process@resource://gre/modules/Promise-backend.js:922:23walkerLoop@resource://gre/modules/Promise-backend.js:806:7Promise*scheduleWalkerLoop@resource://gre/modules/Promise-backend.js:739:11schedulePromise@resource://gre/modules/Prom

Start here. There are tutorials on HTML(the structure of the document or application), CSS(styling of the structure), and JavaScript (programming language, used to interact with the page).

If you don't know a term search on MDN, and you should be able to find whatever you need.

Text Editor

You will need to download a text editor, this will make it easier to write code by auto-completing, syntax highlighting, and other helpful features.

ReferenceError: window is not defined
at new InstallHistory (/home/meandave/moz-code/testpilot/frontend/src/app/lib/install-history.js:9:10)
at Object.<anonymous> (/home/meandave/moz-code/testpilot/frontend/src/app/lib/moz.js:6:24)
at Module._compile (module.js:541:32)
at loader (/home/meandave/moz-code/testpilot/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/home/meandave/moz-code/testpilot/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
@meandavejustice
meandavejustice / get-document-dimensions.js
Created September 5, 2016 15:52
Get browser document dimensions from Firefox SDK Panel (thanks @6a68)
const { getMostRecentBrowserWindow, getXULWindow } = require('sdk/window/utils');
module.exports = getDocumentDimensions;
function getDocumentDimensions() {
let chromeWindow = getMostRecentBrowserWindow();
if (!chromeWindow.document) {
chromeWindow = getXULWindow(chromeWindow);
}
@meandavejustice
meandavejustice / make-panel-transparent.js
Last active September 5, 2016 15:38
Make Firefox's SDK Panel Transparent (from @6a68)
const { getActiveView } = require('sdk/view/core');
module.exports = makePanelTransparent;
function makePanelTransparent(panel) {
// Get the panel element in the XUL DOM and make its background
// transparent.
// TODO: not sure this is e10s compatible.
const el = getActiveView(panel);
el.style.background = 'rgba(0,0,0,0)';