diff --git a/popup/src/classes/Service/NotificationCleaner.ts b/popup/src/classes/Service/NotificationCleaner.ts index 7677b33..fd0a2b2 100644 --- a/popup/src/classes/Service/NotificationCleaner.ts +++ b/popup/src/classes/Service/NotificationCleaner.ts @@ -1,19 +1,19 @@ export class NotificationCleaner { enable () { - chrome.storage.sync.set({ 'need-clean-notification': true }, function () { + chrome.storage && chrome.storage.sync.set({ 'need-clean-notification': true }, function () { console.log('need-clean-notification: ' + true) }) } disable () { - chrome.storage.sync.set({ 'need-clean-notification': false }, function () { + chrome.storage && chrome.storage.sync.set({ 'need-clean-notification': false }, function () { console.log('need-clean-notification: ' + false) }) } state (): Promise { return new Promise((resolve, reject) => { - chrome.storage.sync.get(['need-clean-notification'], function (result) { + chrome.storage && chrome.storage.sync.get(['need-clean-notification'], function (result) { console.log('Value currently is ' + result['need-clean-notification']) resolve(result['need-clean-notification'] || false) }) diff --git a/popup/src/components/script.ts b/popup/src/components/script.ts index e8eb89b..51f12e5 100644 --- a/popup/src/components/script.ts +++ b/popup/src/components/script.ts @@ -17,4 +17,9 @@ Vue.use(VueClipboard) }) export default class HelloWorld extends Vue { tab = 'person' + + isPlugin (): boolean { + console.log(chrome) + return !!chrome.tabs + } } diff --git a/popup/src/components/template.html b/popup/src/components/template.html index be5c380..0d0f7a4 100644 --- a/popup/src/components/template.html +++ b/popup/src/components/template.html @@ -7,7 +7,7 @@
Mocks
-
+
Ember
@@ -18,7 +18,7 @@
-
+