Skip to content

Instantly share code, notes, and snippets.

View bgrins's full-sized avatar

Brian Grinstead bgrins

View GitHub Profile
HUDService.getBrowserConsole().ui.webConsoleClient.getCachedMessages(["PageError"], foo => {
console.log('resolve', foo.messages);
let m = foo.messages[foo.messages.length - 1];
console.log(m.errorMessage.initial.length);
let longString = HUDService.getBrowserConsole().ui.webConsoleClient.longString(m.errorMessage);
console.log("Going to fetch longstring", longString, longString.initial.length, longString.length)
longString.substring(longString.initial.length, longString.length, f=> {
console.log(f);
@bgrins
bgrins / damp-standalone.js
Created April 24, 2015 22:30
damp-standalone
/* Run this in a Scratchpad in Browser Context */
let {devtools} =
Components.utils.import("resource://gre/modules/devtools/Loader.jsm", {});
let { getActiveTab } = devtools.require("sdk/tabs/utils");
let { getMostRecentBrowserWindow } = devtools.require("sdk/window/utils");
function addTab(url = "http://localhost/page_load_test/tp5n/bild.de/www.bild.de/index.html") {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
@bgrins
bgrins / Browser Console Helpers
Last active April 26, 2024 21:54
Helpers that can be used when debugging Firefox in the Browser Console / Browser Debugger
Helpers that can be used when debugging Firefox in the Browser Console / Browser Debugger
@bgrins
bgrins / migrate-mq
Created September 21, 2015 18:48
Migrate MQ patch post bug 912121
# npm install -g replace
# back up the patch
cp .hg/patches/PATCHNAME ~/Desktop/PATCHNAME.patch
replace 'browser/devtools/' 'devtools/client/' .hg/patches/PATCHNAME
replace 'toolkit/devtools/server/' 'devtools/server/' .hg/patches/PATCHNAME
replace 'toolkit/devtools/' 'devtools/shared/' .hg/patches/PATCHNAME
replace 'browser/themes/shared/devtools/' 'devtools/client/themes/' .hg/patches/PATCHNAME
data:text/html,<meta charset='UTF-8'>
<iframe src="data:text/html,<meta charset='UTF-8'><button id='button1'>button1</button>" id="frame-1"></iframe>
<iframe src="data:text/html,<meta charset='UTF-8'><button id='button2'>button2</button>" id="frame-2"></iframe>
<script>
var frame1 = document.querySelectorAll("iframe")[0];
var frame2 = document.querySelectorAll("iframe")[1];
var frame1Button = null;
var frame2Button = null;
hg bookmark -r 98920f7f8a71 bug-xxx-fix
hg update bug-xxx-fix
hg pull mozilla-inbound
hg rebase -b . -d mozilla-inbound
# make sure you're pushing the correct patch :)
hg out -r . mozilla-inbound
hg push -r . mozilla-inbound
<!DOCTYPE html [
<!ENTITY browserStylesLabel "Browser styles">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
&browserStylesLabel;
</html>

Refused to load the script 'http://www.cspplayground.com/static/jquery-1.9.1.js' because it violates the following Content Security Policy directive: "script-src http://www.google-analytics.com".

Refused to load the script 'http://www.cspplayground.com/static/csp_parse.js' because it violates the following Content Security Policy directive: "script-src http://www.google-analytics.com".

Refused to load the script 'http://www.cspplayground.com/static/bootstrap/js/bootstrap-alert.js' because it violates the following Content Security Policy directive: "script-src http://www.google-analytics.com".

Refused to load the script 'http://www.cspplayground.com/static/bootstrap/js/bootstrap-modal.js' because it violates the following Content Security Policy directive: "script-src http://www.google-analytics.com".

Refused to load the script 'http://www.cspplayground.com/static/bootstrap/js/bootstrap-affix.js' because it violates the following Content Security Policy directive: "script-src http://www.google-analytics.c

@bgrins
bgrins / ..mozconfig
Last active May 23, 2016 21:10
.mozconfig files
Sample devtools .mozconfig files
@bgrins
bgrins / reviewers.txt
Last active April 26, 2024 19:59
hg log devtools -r 'date(-180)' --template '{desc|firstline}\n' | awk '{split($0,a,"r=");print tolower(a[2])}' | grep -v "^$" | sort | uniq -c
1 miker
1 ato for marionette, rs=mossop for rest)
5 backout
1 backout a=backout on a closed tree
1 backout on a closed tree
1 baku
1 baku,
1 baku,bgrins
86 bgrins
1 bgrins, jsantell