Skip to content

Commit 0679028

Browse files
Merge pull request #377 from AutomationSolutionz/recorder
Activate Inspector, indent bug fix, Inspector all browser support
2 parents 534545a + bd8f2f0 commit 0679028

File tree

4 files changed

+538
-547
lines changed

4 files changed

+538
-547
lines changed

Apps/Web/aiplugin/background.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const browserAppData = chrome;
1+
const browserAppData = chrome || browser;
22
const tabs = {};
33
const inspectFile = 'inspect.js';
44
const activeIcon = 'active-64.png';
@@ -7,18 +7,18 @@ let zeuz_url = '__ZeuZ__UrL_maPP';
77
let zeuz_key = '__ZeuZ__KeY_maPP';
88

99
function logout() {
10-
chrome.storage.local.remove(['key'], function() {
10+
browserAppData.storage.local.remove(['key'], function() {
1111
alert("Logged out successfully!");
1212
});
1313
}
14-
chrome.contextMenus.create({
14+
browserAppData.contextMenus.create({
1515
title: "Logout",
1616
contexts: ["all"],
1717
// onclick: logout,
1818
id: "zeuz_inspector"
1919
});
2020

21-
chrome.contextMenus.onClicked.addListener(logout);
21+
browserAppData.contextMenus.onClicked.addListener(logout);
2222

2323
const inspect = {
2424
toggleActivate: (id, type, icon) => {
@@ -71,7 +71,7 @@ function toggle(tab) {
7171
// inspect.toggleActivate(tab.id, 'activate', activeIcon);
7272

7373
// check key exists
74-
chrome.storage.local.get(['key'], function(result) {
74+
browserAppData.storage.local.get(['key'], function(result) {
7575
// console.log('Value currently is ' + result.key);
7676

7777
if (result.key != null) {
@@ -127,8 +127,8 @@ function toggle(tab) {
127127
alert("Sorry! Api key is wrong.");
128128
} else {
129129
// save server url and api key
130-
// chrome.storage.local.set({ url: server_url ,key: api_key }, function () {
131-
chrome.storage.local.set({
130+
// browserAppData.storage.local.set({ url: server_url ,key: api_key }, function () {
131+
browserAppData.storage.local.set({
132132
url: server_url,
133133
key: JSON.parse(this.responseText).token
134134
},
@@ -159,7 +159,7 @@ function toggle(tab) {
159159
xhr.open("GET", server_url + "/api/auth/token/verify?api_key=" + api_key);
160160
xhr.send();
161161
} else {
162-
chrome.storage.local.set({
162+
browserAppData.storage.local.set({
163163
url: server_url,
164164
key: zeuz_key,
165165
},

0 commit comments

Comments
 (0)