Skip to content

Instantly share code, notes, and snippets.

@mikeconley
Created March 23, 2021 19:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeconley/304d347b3ec5dfc3552f1311b83efab6 to your computer and use it in GitHub Desktop.
Save mikeconley/304d347b3ec5dfc3552f1311b83efab6 to your computer and use it in GitHub Desktop.

IndexedDB

  1. Set dom.indexedDB.storageOption.enabled to true, then restart the browser
  2. Go to a webpage, and in the devtools console, paste this in:
let request = indexedDB.open(name, { version: 1, storage: "persistent" });

DRM

  1. In the Browser Console, paste in:
gBrowser.selectedBrowser.browsingContext.currentWindowGlobal.getActor("EncryptedMedia").showPopupNotificationForSuccess(gBrowser.selectedBrowser)
  1. Press enter, switch back to browser window, and click on icon in the URL bar

WebMIDI

  1. Set dom.webmidi.enabled to true and then restart the browser
  2. Visit https://permission.site/
  3. Click on "MIDI"

XR

  1. In the Browser Console, paste in:
{
function makeMockPermissionRequest(browser) {
  let type = {
    options: Cc["@mozilla.org/array;1"].createInstance(Ci.nsIArray),
    QueryInterface: ChromeUtils.generateQI(["nsIContentPermissionType"]),
  };
  let types = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
  types.appendElement(type);
  let principal = browser.contentPrincipal;
  let result = {
    types,
    isHandlingUserInput: false,
    principal,
    topLevelPrincipal: principal,
    requester: null,
    _cancelled: false,
    cancel() {
      this._cancelled = true;
    },
    _allowed: false,
    allow() {
      this._allowed = true;
    },
    getDelegatePrincipal(aType) {
      return principal;
    },
    QueryInterface: ChromeUtils.generateQI(["nsIContentPermissionRequest"]),
  };
  // In the e10s-case, nsIContentPermissionRequest will have
  // element defined. window is defined otherwise.
  if (browser.isRemoteBrowser) {
    result.element = browser;
  } else {
    result.window = browser.contentWindow;
  }
  return result;
}
const { PermissionUI } = ChromeUtils.import(
  "resource:///modules/PermissionUI.jsm"
);
let Prompt = PermissionUI.XRPermissionPrompt;
let mockRequest = makeMockPermissionRequest(gBrowser.selectedBrowser);
let TestPrompt = new Prompt(mockRequest);
TestPrompt.prompt()
}

and press enter. Switch back to the browser window.

Canvas

  1. Set privacy.resistFingerprinting to true and restart the browser
  2. Visit https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas_ispointinpath
  3. Click on the icon in the URL bar

DoH

  1. Set browser.newtabpage.activity-stream.asrouter.devtoolsEnabled to true
  2. In about:home / about:newtab, click on the wrench in the top right corner
  3. Hit Cmd/Ctrl-F to open the findbar, and search for DOH_ROLLOUT_CONFIRMATION_89
  4. Next to that entry, click "Show"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment