Skip to content

Instantly share code, notes, and snippets.

@mostlygeek
mostlygeek / firefox-heartbeat.js
Created September 6, 2018 23:38
Manually triggering normandy's show-heartbeat action w/ the Fx browser console
// copy + paste these commands into the browser console to trigger
// the heartbeat pop up
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://normandy/lib/Heartbeat.jsm");
ChromeUtils.import("resource://normandy/lib/SandboxManager.jsm");
const recentWindow = Services.wm.getMostRecentNonPBWindow("navigator:browser");
const sm = new SandboxManager();
new Heartbeat(recentWindow, sm, {flowId: "test",
@wellington1993
wellington1993 / Loader.jsm
Created January 11, 2020 00:14
resource://devtools/shared/Loader.jsm
/* 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/. */
"use strict";
/**
* Manages the base loader (base-loader.js) instance used to load the developer tools.
*/
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 21:46
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser! If you absolutely need to use browser instead of desktop app, use an extension to add the string Electron/ anywhere in your user-agent.

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
@davidteren
davidteren / nerd_fonts.md
Last active April 26, 2024 21:46
Install Nerd Fonts via Homebrew [updated & fixed]
@ncalexan
ncalexan / bu.js
Created September 15, 2020 22:35
"use strict";
// Copied form
// taskcluster/docker/periodic-updates/scripts/getHSTSPreloadList.js,
// which simplified a version from
// browser/components/migration/MigrationUtils.jsm.
function spinResolve(promise) {
if (!(promise instanceof Promise)) {
return promise;
}
"use strict";
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
const { ProcessorBase } = ChromeUtils.import("resource://rewrites/Processor.jsm");
const { Replacer } = ChromeUtils.import("resource://rewrites/Replacer.jsm");
const { Parser, NodeWalker } = ChromeUtils.import("resource://rewrites/Parser.jsm");
var EXPORTED_SYMBOLS = ["Processor"];
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="localized.js"></script>
</head>
<body>
</body>
</html>
@wellington1993
wellington1993 / webconsole-ui.js
Created January 15, 2020 22:53
resource://devtools/client/webconsole/webconsole-ui.js
/* 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/. */
"use strict";
const { Utils: WebConsoleUtils } = require("devtools/client/webconsole/utils");
const EventEmitter = require("devtools/shared/event-emitter");
const Services = require("Services");
const {
21:53:57.643 Error while detaching the browsing context target front: Error: "Protocol error (noSuchActor): No such actor for ID: server1.conn0.child60/frameTarget1"
onPacket resource://devtools/shared/protocol/Front.js:276
callFunctionWithAsyncStack resource://devtools/shared/platform/stack.js:61
onPacket resource://devtools/shared/protocol/Front.js:266
onPacket resource://devtools/shared/client/debugger-client.js:498
send resource://devtools/shared/transport/local-transport.js:68
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:111
browsing-context.js:140:15