Skip to content

Instantly share code, notes, and snippets.

View botatooo's full-sized avatar
🥐

Aidan T. botatooo

🥐
View GitHub Profile
@botatooo
botatooo / dont-edit-teams-docs.user.js
Last active June 8, 2023 02:04
because you don't want to accidentally edit a reference document a teacher forgot to mark as view-only and have your name appear on the Modified-By List of Shame™ - Userscript
// ==UserScript==
// @name Don't Edit Documents from Teams
// @version 1
// @include https://*.sharepoint.com/*
// @grant none
// ==/UserScript==
const searchParams = new URLSearchParams(location.search)
if (searchParams.get("wdOrigin") === "TEAMS-ELECTRON.teamsSdk.openFilePreview" && searchParams.get("action") === "edit") {