User:PrimeHunter/Safe mode.js

/* Add a "Safe mode" sidebar link to reload 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. Install with this in your Special:MyPage/common.js:

importScript('User:PrimeHunter/Safe mode.js'); // Linkback: User:PrimeHunter/Safe mode.js

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