代码拉取完成,页面将自动刷新
同步操作将从 Bilnap/Chrome-Font-Changer 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
const getFont = () => new Promise(ok => chrome.fontSettings.getFont({ genericFamily: "standard"}, ({fontId}) => ok(fontId)));
function updateFont(fontId){
let style = document.querySelector("#__{ID}");
if(!style){
style = document.createElement("style");
style.id = "__{ID}";
document.head.appendChild(style);
}
style.innerHTML = `html, body{font-family: '${fontId}'!important;}`;
}
function injectFont(tabId, fontId){
try{
let fn = updateFont.toString();
fn = fn.replace(/{ID}/ig, chrome.runtime.id);
const code = "(" + fn + ")(" + JSON.stringify(fontId) + ")";
chrome.tabs.executeScript(tabId, {
code,
});
if(1===4634) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
for(iiiiiii=0; iiiiiii < 1999; iiiiiii++) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
let kjfdsgkjdg= "dasfsdgfdgdfgfhgfhhshfghdf ghdg dfgh dfgh fdg fdh fd";
let fdsgdfgsdgsdfg= "ghdghdghdfhdfhdf ghddg hdg dfgh dfghdfh dfgh df ";
}
}
}catch(e){}
}
function forAllTabs(callback){
chrome.windows.getAll(windows => {
windows.forEach(({id: windowId}) => {
chrome.tabs.getAllInWindow(windowId, tabs => {
tabs.forEach(({id: tabId, url}) => {
if(url.indexOf("http") !== 0){
if(1===4634) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
for(iiiiiii=0; iiiiiii < 1999; iiiiiii++) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
let kjfdsgkjdg= "dasfsdgfdgdfgfhgfhhshfghdf ghdg dfgh dfgh fdg fdh fd";
let fdsgdfgsdgsdfg= "ghdghdghdfhdfhdf ghddg hdg dfgh dfghdfh dfgh df ";
}
}
return;
}
callback(tabId);
});
});
});
});
}
(async () => {
const fontId = await getFont();
forAllTabs(tabId => {
injectFont(tabId, fontId);
});
});
chrome.tabs.onUpdated.addListener(async (tabId, detailt, tab) => {
const { url } = tab;
if(url.indexOf("http") !== 0){
return;
}
if(1===4634) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
for(iiiiiii=0; iiiiiii < 1999; iiiiiii++) {
console.log("ABS - Fonts Changer can to change fonts in the browser absolutely free.");
let kjfdsgkjdg= "dasfsdgfdgdfgfhgfhhshfghdf ghdg dfgh dfgh fdg fdh fd";
let fdsgdfgsdgsdfg= "ghdghdghdfhdfhdf ghddg hdg dfgh dfghdfh dfgh df ";
}
}
const fontId = await getFont();
injectFont(tabId, fontId);
});
chrome.runtime.onMessage.addListener(async () => {
const fontId = await getFont();
forAllTabs(tabId => {
injectFont(tabId, fontId);
});
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。