They look similar on recent Chrome versions, however, page actions can be toggled on/off and it doesn't make sense to have the button enabled outside github.com
Toggling the style will now affect other open GitHub tabs too, no need to reload the page!
Fix bugged code logic at content script
If there are no results for getElementsByClassName(), it will return null... but we immediately try to get the first result from the array, which will throw an Error... therefore the if statement beneath is completely pointless
// check if element exists yet
var element = document.getElementsByClassName("header-dark")[0];
if (element) {
Change browser action to page action
They look similar on recent Chrome versions, however, page actions can be toggled on/off and it doesn't make sense to have the button enabled outside github.com
Toggling the style will now affect other open GitHub tabs too, no need to reload the page!
Fix bugged code logic at content script
If there are no results for
getElementsByClassName()
, it will returnnull
... but we immediately try to get the first result from the array, which will throw an Error... therefore theif
statement beneath is completely pointlessRemove scary “Access your browsing activity” permission, no need for that anymore
Set Chrome minimum version to 26 as
chrome.runtime.sendMessage
is usedIt's possible to make it work on even older Chrome versions, but seriously, upgrade :p