Apply styles to own pages earlier to avoid flicker
This commit is contained in:
parent
83b2e1d53d
commit
7c53643b19
7
apply.js
7
apply.js
|
@ -1,4 +1,9 @@
|
||||||
chrome.extension.sendMessage({method: "getStyles", matchUrl: location.href, enabled: true, asHash: true}, applyStyles);
|
var request = {method: "getStyles", matchUrl: location.href, enabled: true, asHash: true};
|
||||||
|
if (location.href.indexOf(chrome.extension.getURL("")) == 0) {
|
||||||
|
chrome.extension.getBackgroundPage().getStyles(request, applyStyles);
|
||||||
|
} else {
|
||||||
|
chrome.extension.sendMessage(request, applyStyles);
|
||||||
|
}
|
||||||
|
|
||||||
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
|
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
|
||||||
switch (request.method) {
|
switch (request.method) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user