Skip to content

Instantly share code, notes, and snippets.

window.onload = function() {
$("#login").click(function(event) {
chrome.identity.launchWebAuthFlow(
{'url': 'http://localhost:3000/oauth/authorize?client_id=7b529aed5e89c14bd45c4cb949f220e5bc4cc440003dd7604d3fc6ed43f29844&redirect_uri=https%3A%2F%2Fhnjjholodahaklljjenjpfbkkghppdpk.chromiumapp.org%2Fvyrtex-chrome-extension&response_type=code', 'interactive': true},
function(redirect_url) {
console.log(redirect_url);
var code = redirect_url.substring(redirect_url.indexOf("=") + 1, redirect_url.length );
exchangeCodeForToken(code);
});
@erikvold
erikvold / webextensions-manifesto.md
Created November 20, 2015 12:33
We need Worse Add-ons

We need Worse Add-ons

Add-ons for Firefox today are too good! we must stop this!

If add-ons become too powerful then users will have control of their own lives. We must put a stop to this. How can we be more like Google, Apple, or the gold standard of our industry, Microsoft?

Mozilla must do something today if it is going to take back control from it’s users. Firefox can’t be allowed to be contorted to user preference. It must be firm and boldly copy Google Chrome.

Users however will need to be placated to for the short term. Least they mobilize and fork the fox. So we should make it possible to do anything, whilst constantly striving to make that possibility harder to achieve.

@erikvold
erikvold / failing-attempt.txt
Last active August 29, 2015 14:19
failing-attempt.txt
$ android create avd --force -n jetpack -t android-17 --abi armeabi-v7a
$ mksdcard -l jetpackSdCard 1024M ~/jetpacksdcard.img
$ emulator -avd jetpack -sdcard ~/jetpacksdcard.img -no-audio -gpu on -no-boot-anim -noskin -no-window
$ adb shell input keyevent 82
$ adb shell input keyevent 82
$ adb install fennec.apk
$ node ../../bin/jpm-mobile test --adb ~/android-sdk-macosx/platform-tools/adb -v -b fennec
jpm-mobile test
JPM undefined Checking compatability bootstrap.js and install.rdf for xpi
@erikvold
erikvold / working-attempt.txt
Last active August 29, 2015 14:19
working-attempt.txt
$ android create avd --force -n jetpack -t android-17 --abi armeabi-v7a
$ mksdcard -l jetpackSdCard 1024M ~/jetpacksdcard.img
$ emulator -avd jetpack -sdcard ~/jetpacksdcard.img -no-audio -gpu on -no-boot-anim -noskin
$ adb shell input keyevent 82
$ adb shell input keyevent 82
$ adb install fennec.apk
$ node ../../bin/jpm-mobile test --adb ~/android-sdk-macosx/platform-tools/adb -v -b fennec
jpm-mobile test
JPM undefined Checking compatability bootstrap.js and install.rdf for xpi
@erikvold
erikvold / jpm.travis.yml
Last active August 29, 2015 14:07
removing an unecessary line
language: node_js
node_js:
- "0.10"
before_install:
- "export DISPLAY=:99.0"
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 -extension RANDR"
before_script:
- npm install jpm -g
"Failed to bootstrap addon: " "@param-dump" Object { , 5 more… } bootstrap.js:301
"notDebuggee: cannot access the environment of this function." VariablesViewController.jsm:217
fileName: resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///C:/Users/ERIK_V~1/AppData/Local/Temp/462b7936-7016-4e82-a393-b56828794030/extensions/@param-dump.xpi!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/frame/utils.js
lineNumber: 52
stack: "create@resource://gre/modules/commonjs/sdk/frame/utils.js:52:7@resource://gre/modules/commonjs/sdk/addon/window.js:32:13startup@resource://gre/modules/commonjs/sdk/addon/runner.js:101:19startup/<@jar:file:///C:/Users/ERIK_V~1/AppData/Local/Temp/462b7936-7016-4e82-a393-b56828794030/extensions/@param-dump.xpi!/bootstrap.js:294:7TaskImpl_run@resource://gre/modules/Task.jsm:330:41Handler.prototype.process@resource://gre/modules/Promise-backend.js:866:23this.PromiseWalker.walkerLoop@resource://gre/modules/Promise-backend.js:74
// ==UserScript==
// @id bugzilla.mozilla.org-b9491ced-55b7-7249-89de-319b54e4a4d1@erikvold
// @name Bugzilla - Input type text
// @version 1.0
// @namespace erikvold
// @author Erik Vold
// @description
// @include https://bugzilla.mozilla.org/show_bug.cgi?id=*
// @run-at document-end
// ==/UserScript==
"use strict";
const { Reactor } = require("sdk/event/utils");
const { Loaded } = require("sdk/input/window");
const reactor = new Reactor({
onStart: initial => {
console.log('start')
console.log(initial)
},
// ==UserScript==
// @id sdk-doc-extractor@erikvold.com
// @name SDK Docs Extractor
// @version 1.0.7
// @namespace erikvold
// @author Erik Vold
// @description
// @include file:///*/addon-sdk/doc/*
// @grant GM_registerMenuCommand
// @grant GM_safeHTMLParser
<html>
<body>
<button id="testB">click me!!</button>
<script>
var s = document.readyState;
document.getElementById('testB').addEventListener("click", function(event) {
alert(s);
}, false);
document.addEventListener("DOMContentLoaded", function(event) {
alert(s);