Move all checks into one statement
This commit is contained in:
parent
fbc27096d9
commit
c20800be80
|
@ -6,28 +6,22 @@ chrome.runtime.getPlatformInfo(function(info) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateTab(info) {
|
function updateTab(info) {
|
||||||
// Ignore pinned tabs
|
if (
|
||||||
if (info.pinned) {
|
// Ignore pinned tabs
|
||||||
return;
|
info.pinned ||
|
||||||
}
|
|
||||||
|
|
||||||
// We can only fast switch to tabs 1-9
|
// We can only fast switch to tabs 1-9
|
||||||
if (info.index > 8) {
|
info.index > 8 ||
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Don't change title unless request is complete
|
// Don't change title unless request is complete
|
||||||
if (info.status !== "complete") {
|
info.status !== "complete" ||
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore chrome pages
|
// Ignore chrome and file urls
|
||||||
if (!info.url.indexOf('http') === 0) {
|
!info.url.indexOf('http') === 0 ||
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore Chrome Web Store (restricted)
|
// Ignore Chrome Web Store
|
||||||
if (info.url.indexOf('https://chrome.google.com/webstore/') === 0) {
|
info.url.indexOf('https://chrome.google.com/webstore/') === 0
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue