Skip to content

Commit

Permalink
added fixes for Firefox mobile on Android, #6
Browse files Browse the repository at this point in the history
  • Loading branch information
AykutCevik committed Feb 24, 2018
1 parent e48f2f1 commit f5e4f03
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions html/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<script src="../js/material.min.js"></script>
<link rel="stylesheet" href="../css/material_fonts.css">
<link rel="stylesheet" href="../css/options.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer mdl-layout--fixed-header">
Expand Down
1 change: 1 addition & 0 deletions html/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<script src="../js/material.min.js"></script>
<link rel="stylesheet" href="../css/material_fonts.css">
<link rel="stylesheet" href="../css/popup.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>

Expand Down
24 changes: 20 additions & 4 deletions js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,27 @@ function whitelistDomains(domains) {

function updateTabIcon(tabId) {
if (blockedTabs[tabId]) {
browser.browserAction.setIcon({tabId: tabId, path: "../img/icon_red_48.png"});
browser.browserAction.setBadgeText({tabId: tabId, "text": "" + blockedTabs[tabId]});
if (browser.browserAction.setIcon !== undefined) {
browser.browserAction.setIcon({tabId: tabId, path: "../img/icon_red_48.png"});
browser.browserAction.setBadgeText({tabId: tabId, "text": "" + blockedTabs[tabId]});
}
if (browser.browserAction.setTitle !== undefined ) {
browser.browserAction.setTitle({
tabId: tabId,
title: browser.runtime.getManifest().name + " (BLOCKED)"
});
}
} else {
browser.browserAction.setIcon({tabId: tabId, path: "../img/icon_48.png"});
browser.browserAction.setBadgeText({tabId: tabId, "text": ""});
if (browser.browserAction.setIcon !== undefined) {
browser.browserAction.setIcon({tabId: tabId, path: "../img/icon_48.png"});
browser.browserAction.setBadgeText({tabId: tabId, "text": ""});
}
if (browser.browserAction.setTitle !== undefined ) {
browser.browserAction.setTitle({
tabId: tabId,
title: browser.runtime.getManifest().name
});
}
}
}

Expand Down

0 comments on commit f5e4f03

Please sign in to comment.