Skip to content

Commit

Permalink
Fix google translate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
lcandy2 committed Jul 20, 2023
1 parent b598c3f commit b5e4534
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const outputFolderPathChrome = outputFolderPathBase + '/chrome';
const outputFolderPathFirefox = outputFolderPathBase + '/firefox';
const outputToBoth = !isChrome && !isFirefox; // Whether to output to both folders
const packageVersion = JSON.parse(fs.readFileSync('package.json')).version
const [versionYear, versionMonth] = packageVersion.split(".");
const [versionYear, versionMonth, versionSuffix] = packageVersion.split(".");
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const packageVersionName = `${versionYear} ${months[parseInt(versionMonth) - 1]}`;
const packageVersionName = `${versionYear} ${months[parseInt(versionMonth) - 1]} ${versionSuffix}`;

const manifestJson = {
manifest_version: 3,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Select-like-a-Boss",
"version": "2023.7",
"version": "2023.7.33",
"scripts": {
"build": "node manifest.js"
},
Expand Down
8 changes: 6 additions & 2 deletions src/Select-like-a-Boss.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const handlers = {
if (userSelecting) {
justSelected = true;
addEvent('click', handlers.click);
// console.log('add click event', userSelecting)
}
toggleUserSelect(e.target, false);
},
Expand All @@ -50,7 +51,10 @@ const handlers = {
click: (e) => {
if (justSelected) {
justSelected = false;
removeEvent('click', handlers.click);
setTimeout(() => {
removeEvent('click', handlers.click);
// console.log('remove click event', userSelecting)
}, 50);
return stopEvent(e);
}
},
Expand All @@ -67,7 +71,7 @@ const toggleUserSelect = (node, enable = false) => {
};

document.addEventListener('mousedown', (e) => {
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')
const excludeTags = e.target.closest('img, canvas, picture, svg, audio, video, object, progress, textarea')
let excludeTagsCount = 1;
if (excludeTags) excludeTagsCount = excludeTags.childElementCount;
if (e.button !== 0 || excludeTagsCount === 0) { excludeTagsCount = 1; return; }
Expand Down

0 comments on commit b5e4534

Please sign in to comment.