Jump to content

User:Sportzpikachu/bookmarks.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
Promise.all( [ fetch( '/w/index.php?title=Special:MyPage/bookmarks.json&action=raw&ctype=application/json' ), mw.loader.using( 'mediawiki.util' ) ] )
	.then( ( [ r ] ) => r.json() )
	.then( ( bookmarks ) => {
		mw.util.addPortlet( 'p-bookmarks', 'Bookmarks [edit]', '#p-interaction' );
		if ( !document.querySelector( '#p-bookmarks' ) ) {
			// fallback
			mw.util.addPortlet( 'p-bookmarks', 'Bookmarks [edit]', '#p-tb' );
		}
		const heading = document.querySelector( '#p-bookmarks > .vector-menu-heading' );
		if ( heading ) {
			heading.innerHTML =
				'Bookmarks [<a href="/w/index.php?title=Special:MyPage/bookmarks.json&action=edit">edit</a>]';
		}

		for ( const bookmark of bookmarks ) {
			mw.util.addPortletLink(
				'p-bookmarks',
				mw.util.getUrl( bookmark.url ),
				bookmark.name,
				null,
				null,
				bookmark.accesskey,
			);
		}
	} );
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy