Skip to content

Instantly share code, notes, and snippets.

@theand
Created June 7, 2019 07:22
Show Gist options
  • Save theand/648dae5f82bc1272e3918b07ca27d050 to your computer and use it in GitHub Desktop.
Save theand/648dae5f82bc1272e3918b07ca27d050 to your computer and use it in GitHub Desktop.
designmode-on
// ==UserScript==
// @name designmode-on
// @namespace http://127.0.0.1
// @description User Script for designmode-on
// @author Heesang Chae
// @include *
// @require https://cdn.jsdelivr.net/gh/theand/userscript-util@latest/exec.js
// @version 2018.01.09
// @grant none
// ==/UserScript==
/*global userscript_util*/
/* ref:
* https://twitter.com/IMAC2/status/1135875294156480512
* https://developer.mozilla.org/en-US/docs/Web/API/Document/designMode
*/
const userscript = function (GM_info) {
console.group(GM_info.script.name);
userscript_util.exec.logGmInfo(GM_info);
try {
document.designMode = "on";
} catch (err) {
userscript_util.exec.logGmError(GM_info, err);
}
console.groupEnd();
};
if(top.document.location === self.document.location) {
userscript_util.exec.executeLater(userscript, GM_info, 1500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment