Skip to content

Commit

Permalink
Firefox compatibility patch
Browse files Browse the repository at this point in the history
  • Loading branch information
noa committed Mar 30, 2021
1 parent 0edfe26 commit 09830d5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
13 changes: 8 additions & 5 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
"48": "assets/thumbnail.png",
"128": "assets/thumbnail.png"
},
"background": {
"scripts": ["scripts/background.js"],
"persistent": false
},
"permissions": [
"background": {
"scripts": ["scripts/background.js"],
"persistent": false
},
"permissions": [
"https://github.com/*",
"https://api.github.com/*",
"https://leetcode.com/*",
"tabs",
"activeTab",
"unlimitedStorage",
Expand Down
1 change: 1 addition & 0 deletions popup.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/popup.css" />
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
Expand Down
4 changes: 2 additions & 2 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ $('#authenticate').on('click', () => {
/* Get URL for welcome page */
$('#welcome_URL').attr(
'href',
`chrome-extension://${chrome.runtime.id}/welcome.html`,
chrome.runtime.getURL('welcome.html')
);
$('#hook_URL').attr(
'href',
`chrome-extension://${chrome.runtime.id}/welcome.html`,
chrome.runtime.getURL('welcome.html')
);

chrome.storage.local.get('leethub_token', (data) => {
Expand Down
4 changes: 2 additions & 2 deletions scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function handleMessage(request) {
});

/* Go to onboarding for UX */
const urlOnboarding = `chrome-extension://${chrome.runtime.id}/welcome.html`;
chrome.tabs.create({ url: urlOnboarding, selected: true }); // creates new tab
const urlOnboarding = chrome.runtime.getURL('welcome.html');
chrome.tabs.create({ url: urlOnboarding, active: true }); // creates new tab
} else if (
request &&
request.closeWebPage === true &&
Expand Down
2 changes: 1 addition & 1 deletion scripts/oauth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const oAuth2 = {
chrome.storage.local.set({ pipe_leethub: true }, () => {
// opening pipe temporarily

chrome.tabs.create({ url, selected: true }, function () {
chrome.tabs.create({ url, active: true }, function () {
window.close();
chrome.tabs.getCurrent(function (tab) {
chrome.tabs.remove(tab.id, function () {});
Expand Down

0 comments on commit 09830d5

Please sign in to comment.