Skip to content

Instantly share code, notes, and snippets.

@kamezz
Created April 13, 2026 04:36
Show Gist options
  • Select an option

  • Save kamezz/88c4c7269bee0687c488345019482aa5 to your computer and use it in GitHub Desktop.

Select an option

Save kamezz/88c4c7269bee0687c488345019482aa5 to your computer and use it in GitHub Desktop.
canvas bypass
// ==UserScript==
// @name canvas
// @namespace Violentmonkey Scripts
// @match https://*.instructure.com/courses/*
// @grant none
// @version 1.0
// @author -
// @description 4/12/2026, 8:56:45 PM
// ==/UserScript==
// Debug log to confirm the injected script actually runs in page context
console.log("✅ Canvas Guard injected into page context");
// Your visibility override logic
Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: true});
Object.defineProperty(document, 'hidden', {value: false, writable: true});
Object.defineProperty(document, 'webkitVisibilityState', {value: 'visible', writable: true});
Object.defineProperty(document, 'webkitHidden', {value: false, writable: true});
Window.prototype.realEventListener = Window.prototype.addEventListener;
Window.prototype.addEventListener = function(a, b, c) {
if (a === "focus" || a === "blur" || a === "visibilitychange") {
console.log(`[AD] '${a}' event subscription prevented.`);
} else {
realEventListener.call(this, a, b, c);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment