Skip to content

Commit

Permalink
FIXED: persistent mode flag now correctly checked when toggling furigana
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Lissoboi committed Jun 25, 2015
1 parent fe31969 commit 903b18a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function enableTabForFI(tab) {

//Page action listener
chrome.pageAction.onClicked.addListener(function(tab) {
if (localStorage.getItem('persistent_mode')) {
if (JSON.parse(localStorage.getItem('persistent_mode')) == true) {
console.log('persistent')
chrome.tabs.query({} ,function (tabs) {
for (var i = 0; i < tabs.length; i++) {
chrome.tabs.executeScript(tabs[i].id, {code: "toggleFurigana();"});
Expand All @@ -108,7 +109,8 @@ chrome.pageAction.onClicked.addListener(function(tab) {

//Keyboard action listener
chrome.commands.onCommand.addListener(function(command) {
if (localStorage.getItem('persistent_mode')) {
if (JSON.parse(localStorage.getItem('persistent_mode')) == true) {
console.log('persistent')
chrome.tabs.query({} ,function (tabs) {
for (var i = 0; i < tabs.length; i++) {
chrome.tabs.executeScript(tabs[i].id, {code: "toggleFurigana();"});
Expand Down

0 comments on commit 903b18a

Please sign in to comment.