Skip to content

Commit b5e4534

Browse files
committed
Fix google translate issue
1 parent b598c3f commit b5e4534

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

manifest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const outputFolderPathChrome = outputFolderPathBase + '/chrome';
99
const outputFolderPathFirefox = outputFolderPathBase + '/firefox';
1010
const outputToBoth = !isChrome && !isFirefox; // Whether to output to both folders
1111
const packageVersion = JSON.parse(fs.readFileSync('package.json')).version
12-
const [versionYear, versionMonth] = packageVersion.split(".");
12+
const [versionYear, versionMonth, versionSuffix] = packageVersion.split(".");
1313
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
14-
const packageVersionName = `${versionYear} ${months[parseInt(versionMonth) - 1]}`;
14+
const packageVersionName = `${versionYear} ${months[parseInt(versionMonth) - 1]} ${versionSuffix}`;
1515

1616
const manifestJson = {
1717
manifest_version: 3,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Select-like-a-Boss",
3-
"version": "2023.7",
3+
"version": "2023.7.33",
44
"scripts": {
55
"build": "node manifest.js"
66
},

src/Select-like-a-Boss.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const handlers = {
4040
if (userSelecting) {
4141
justSelected = true;
4242
addEvent('click', handlers.click);
43+
// console.log('add click event', userSelecting)
4344
}
4445
toggleUserSelect(e.target, false);
4546
},
@@ -50,7 +51,10 @@ const handlers = {
5051
click: (e) => {
5152
if (justSelected) {
5253
justSelected = false;
53-
removeEvent('click', handlers.click);
54+
setTimeout(() => {
55+
removeEvent('click', handlers.click);
56+
// console.log('remove click event', userSelecting)
57+
}, 50);
5458
return stopEvent(e);
5559
}
5660
},
@@ -67,7 +71,7 @@ const toggleUserSelect = (node, enable = false) => {
6771
};
6872

6973
document.addEventListener('mousedown', (e) => {
70-
const excludeTags = e.target.closest('img, p, h1, h2, h3, h4, h5, h6, canvas, code, picture, svg, sub, strong, span, audio, video, em, blockquote, mark, del, ins, sup, abbr, object, embed, progress')
74+
const excludeTags = e.target.closest('img, canvas, picture, svg, audio, video, object, progress, textarea')
7175
let excludeTagsCount = 1;
7276
if (excludeTags) excludeTagsCount = excludeTags.childElementCount;
7377
if (e.button !== 0 || excludeTagsCount === 0) { excludeTagsCount = 1; return; }

0 commit comments

Comments
 (0)