Skip to content

Commit 2134b81

Browse files
committed
When users are not in github or gitlab, bring them to workspaces
1 parent 4ed6821 commit 2134b81

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

background.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
*/
1212

1313
const forcePopup = ({ id, url }) => {
14-
if (/https?:\/\/(github|gitlab).com\/.*\/.*/.test(url) ||
15-
/https?:\/\/gitpod.io\/.*/.test(url)) {
16-
chrome.pageAction.show(id);
17-
}
14+
chrome.pageAction.show(id);
1815
};
1916

2017
chrome.tabs.onUpdated.addListener((tabId, activeInfo, tab) => {
@@ -26,9 +23,9 @@ chrome.tabs.onActivated.addListener(({ tabId }) => {
2623
});
2724

2825
chrome.pageAction.onClicked.addListener(({ url }) => {
29-
let popupUrl = `https://gitpod.io/#${url}`;
30-
if(/https?:\/\/gitpod.io\/.*/.test(url)) {
31-
popupUrl = 'https://gitpod.io/workspaces/';
26+
let popupUrl = 'https://gitpod.io/workspaces/';
27+
if (/https?:\/\/(github|gitlab).com\/.*\/.*/.test(url)) {
28+
popupUrl = `https://gitpod.io/#${url}`;
3229
}
3330
chrome.windows.create({ url: popupUrl, type: 'popup' });
3431
});

manifest.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
},
1111
"author": "Jerome Wu <jeromewus@gmail.com>",
1212
"permissions": [
13-
"tabs",
14-
"*://github.com/*/*",
15-
"*://gitlab.com/*/*",
16-
"*://gitpod.io/*"
13+
"tabs"
1714
],
1815
"background": {
1916
"scripts": ["background.js"],

0 commit comments

Comments
 (0)