User:ToBeFree/scripts/clear-watchlist.js

/* Clear your entire watchlist over time: Remove the first 500 entries each time you open any Wikipedia page. * This script will work even if the watchlist is too full to be edited or cleared by conventional methods. * built using: https://en.wikipedia.org/w/index.php?title=Help:Customizing_toolbars&oldid=982882848, https://www.mediawiki.org/w/index.php?title=API:Watch&oldid=4112591#Sample_code */

$.when( mw.loader.using('mediawiki.util'), $.ready ).then( function { var params = { action: 'watch', unwatch: 'true', generator: 'watchlistraw', gwrlimit: '500', gwrnamespace:'*',   format: 'json'  },  api = new mw.Api; api.postWithToken( 'watch', params ).done( function ( data ) {  console.log( data ); } ); } );