mirror of
https://github.com/ryanamay/pint.git
synced 2024-09-20 01:50:34 +00:00
implementation: make the damn changes on page load
This commit is contained in:
parent
05440f89d5
commit
88f6c1fe8b
5 changed files with 30 additions and 3 deletions
|
@ -23,6 +23,7 @@ chrome.action.onClicked.addListener((tab) => {
|
||||||
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
||||||
chrome.scripting.executeScript({
|
chrome.scripting.executeScript({
|
||||||
target: { tabId: tabId },
|
target: { tabId: tabId },
|
||||||
files: ['onload.js']
|
files: ['initial.js']
|
||||||
}, () => chrome.runtime.lastError);
|
}, () => chrome.runtime.lastError);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -27,3 +27,10 @@ function updateAccents(a1) {
|
||||||
document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important");
|
document.querySelectorAll('.Progress-item.rounded-2')[i].style.setProperty('background-color', a1 + "ff", "important");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
||||||
|
chrome.scripting.executeScript({
|
||||||
|
target: { tabId: tabId },
|
||||||
|
files: ['initial.js']
|
||||||
|
}, () => chrome.runtime.lastError);
|
||||||
|
});
|
|
@ -468,3 +468,11 @@ chrome.runtime.onInstalled.addListener(() => {
|
||||||
console.log("Setup: Configuring " + initialSetting + " >> " + defaultColorScheme[initialSetting]);
|
console.log("Setup: Configuring " + initialSetting + " >> " + defaultColorScheme[initialSetting]);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
|
||||||
|
chrome.scripting.executeScript({
|
||||||
|
target: { tabId: tabId },
|
||||||
|
files: ['initial.js']
|
||||||
|
}, () => chrome.runtime.lastError);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,12 @@
|
||||||
"matches": ["https://*.github.com/*"],
|
"matches": ["https://*.github.com/*"],
|
||||||
"js": ["initial.js"],
|
"js": ["initial.js"],
|
||||||
"css": ["unhide.css"]
|
"css": ["unhide.css"]
|
||||||
|
},{
|
||||||
|
"run_at": "document_idle",
|
||||||
|
"matches": ["https://*.github.com/*"],
|
||||||
|
"js": ["initial.js"]
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"permissions": ["storage", "scripting"],
|
"permissions": ["storage", "scripting"],
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
var link = document.createElement('link');
|
||||||
|
link.href = chrome.extension.getURL('pint-css.css');
|
||||||
|
link.type = 'text/css';
|
||||||
|
link.rel = 'stylesheet';
|
||||||
|
link.media = 'all';
|
||||||
|
document.getElementsByTagName('head')[0].appendChild(link);
|
Loading…
Reference in a new issue