User:PrimeHunter/Safemode edit.js

/* Add a "Safemode edit" sidebar link to edit the current page with safemode=1 added. This disables user js, css and gadgets per https://phabricator.wikimedia.org/T152169. Changes in the edit box and elsewhere will be lost. safemode=1 will disappear on "Show preview" and "Show changes" Install with this in your Special:MyPage/common.js:

importScript('User:PrimeHunter/Safemode edit.js'); // Linkback: User:PrimeHunter/Safemode edit.js

$( document ).ready( function { mw.util.addPortletLink( 'p-tb', location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'action=edit&safemode=1', 'Safemode edit', 't-safemodeedit', 'Edit this page without user js, css and gadgets (discards anything you have entered)' ); });