Skip to content

Commit

Permalink
Add tabType for proper tab handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
cschiller committed May 2, 2021
1 parent 595a681 commit 1e66847
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,9 @@ function disableTab() {
document.removeEventListener('mousemove', onMouseMove);
document.removeEventListener('keydown', onKeyDown);

let zhongwenCSS = document.getElementById('zhongwen-css');
if (zhongwenCSS) {
zhongwenCSS.parentNode.removeChild(zhongwenCSS);
}
let zhongwenToneColors = document.getElementById('zhongwen-toneColors');
if (zhongwenToneColors) {
zhongwenToneColors.parentNode.removeChild(zhongwenToneColors);
}
let zhongwenWindow = document.getElementById('zhongwen-window');
if (zhongwenWindow) {
zhongwenWindow.parentNode.removeChild(zhongwenWindow);
let popup = document.getElementById('zhongwen-window');
if (popup) {
popup.parentNode.removeChild(popup);
}

clearHighlight();
Expand Down Expand Up @@ -171,6 +163,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'grammar',
url: allset
});
}
Expand Down Expand Up @@ -251,6 +244,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'tatoeba',
url: tatoeba
});
}
Expand Down Expand Up @@ -278,6 +272,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'linedict',
url: linedict
});
}
Expand All @@ -293,6 +288,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'forvo',
url: forvo
});
}
Expand All @@ -308,6 +304,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'dictcn',
url: dictcn
});
}
Expand All @@ -323,6 +320,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'iciba',
url: iciba
});
}
Expand All @@ -338,6 +336,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'mdbg',
url: mdbg
});
}
Expand All @@ -354,6 +353,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'jukuu',
url: jukuu
});
}
Expand All @@ -369,6 +369,7 @@ function onKeyDown(keyDown) {

chrome.runtime.sendMessage({
type: 'open',
tabType: 'moedict',
url: moedict
});
}
Expand Down

0 comments on commit 1e66847

Please sign in to comment.