-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbookmarklets.js
11 lines (11 loc) · 1.26 KB
/
bookmarklets.js
1
2
3
4
5
6
7
8
9
10
11
function zapFonts() {
const newFont = prompt('Font','Open Sans').trim();
const xzCss = '@import url("https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/' + newFont.toLocaleLowerCase().replace(' ','-') + '.min.css");';
const gFontsCss = '@import url("https://fonts.googleapis.com/css?family=' + newFont.replace(' ','+') + '&display=swap");';
const newCss = xzCss + gFontsCss + '*{font-family:' + newFont +'!important}code,pre,tt{font-family:monospace!important;}';
const a = document.createElement('link');
a.rel = 'stylesheet';
a.href = 'data:text/css,' + encodeURI(newCss);
document.getElementsByTagName('head')[0].appendChild(a);
}
javascript:(function zapFonts(){const newFont=prompt('Font','Open Sans').trim();const xzCss='@import url("https://cdn.jsdelivr.net/npm/@xz/fonts@1/serve/'+newFont.toLocaleLowerCase().replace(' ','-')+'.min.css");';const gFontsCss='@import url("https://fonts.googleapis.com/css?family='+newFont.replace(' ','+')+'&display=swap");';const newCss=xzCss+gFontsCss+'*{font-family:'+newFont+'!important}code,pre,tt{font-family:monospace!important;}';const a=document.createElement('link');a.rel='stylesheet';a.href='data:text/css,'+encodeURI(newCss);document.getElementsByTagName('head')[0].appendChild(a);})();