Skip to content

Instantly share code, notes, and snippets.

@wellington1993
wellington1993 / NetUtil.jsm
Created February 24, 2020 12:51
resource://gre/modules/NetUtil.jsm
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
* vim: sw=4 ts=4 sts=4 et filetype=javascript
* 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/. */
var EXPORTED_SYMBOLS = ["NetUtil"];
/**
* Necko utilities
@wellington1993
wellington1993 / loader-plugin-raw.jsm
Created February 24, 2020 12:52
resource://devtools/shared/loader-plugin-raw.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";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/**
* A function that can be used as part of a require hook for a
@wellington1993
wellington1993 / rule-rewriter.js
Created February 24, 2020 20:53
resource://devtools/shared/fronts/inspector/rule-rewriter.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/. */
// This file holds various CSS parsing and rewriting utilities.
// Some entry points of note are:
// parseDeclarations - parse a CSS rule into declarations
// RuleRewriter - rewrite CSS rule text
// parsePseudoClassesAndAttributes - parse selector and extract
// pseudo-classes
@wellington1993
wellington1993 / devtools-server-connection.js
Created February 24, 2020 20:56
resource://devtools/server/devtools-server-connection.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";
var { Pool } = require("devtools/shared/protocol");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
var { dumpn } = DevToolsUtils;
@wellington1993
wellington1993 / theme-switching.js
Created February 24, 2020 21:03
chrome://devtools/content/shared/theme-switching.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/. */
/* eslint-env browser */
"use strict";
(function() {
const { require } = ChromeUtils.import(
"resource://devtools/shared/Loader.jsm"
);
@wellington1993
wellington1993 / markup.js
Created February 28, 2020 13:11
view-source:resource://devtools/server/actors/highlighters/utils/markup.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 { Cu, Cr } = require("chrome");
const {
getCurrentZoom,
getWindowDimensions,
@wellington1993
wellington1993 / TooltipTextProvider.jsm
Created March 9, 2020 16:24
resource://gre/modules/TooltipTextProvider.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/. */
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
function TooltipTextProvider() {}
TooltipTextProvider.prototype = {
getNodeText(tipElement, textOut, directionOut) {
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 26, 2024 21:25
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
@wellington1993
wellington1993 / walker.js
Created March 9, 2020 16:25
resource://devtools/server/actors/inspector/walker.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 { Cc, Ci, Cu } = require("chrome");
const Services = require("Services");
const protocol = require("devtools/shared/protocol");
@wellington1993
wellington1993 / HTMLTooltip.js
Created March 11, 2020 22:29
resource://devtools/client/shared/widgets/tooltip/HTMLTooltip.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 Services = require("Services");
const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(