Skip to content

Commit

Permalink
v4.71.1
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
cyfung1031 committed May 7, 2024
1 parent 1caddbf commit 4b69a63
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions js/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4775,6 +4775,7 @@ yt-update-unseen-notification-count yt-viewport-scanned yt-visibility-refresh
}
: (text) => text;

const hiddenTexts = new Map();
const getTextContentArr = async (element) => {
let contentArray = [];

Expand All @@ -4787,6 +4788,7 @@ yt-update-unseen-notification-count yt-viewport-scanned yt-visibility-refresh
while (node = walker.nextNode()) {
const text = node.nodeValue;
if (text && !text.startsWith('\uF204')) {
hiddenTexts.set(node, text);
node.nodeValue = `\uF204${text.replace(/[\uF204\uF205]/g, '')}\uF205`;
}
}
Expand Down Expand Up @@ -4874,7 +4876,13 @@ yt-update-unseen-notification-count yt-viewport-scanned yt-visibility-refresh
return contentArray;
};

hiddenTexts.clear();
const [firstElementTextArr, secondElementTextArr] = await Promise.all([getTextContentArr(firstElement), getTextContentArr(secondElement)]);
hiddenTexts.forEach((t, text) => {
// console.log(128, text.nodeValue, `\uF204${t.replace(/[\uF204\uF205]/g, '')}\uF205`)
if ((text.nodeValue || '') === `\uF204${t.replace(/[\uF204\uF205]/g, '')}\uF205`) text.nodeValue = t;
});
hiddenTexts.clear();

if (typeof GM === 'undefined') {
console.log(7191, firstElementTextArr)
Expand Down
2 changes: 1 addition & 1 deletion js/injection_script_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ function injection_script_1() {
const kurl = url.replace(/^https?:\/\/[\w\.\-]+\//, '/');
if (kloc === kurl) return;
const t = `${kloc}\t${kurl}`;
if (t === mz) return;
// if (t === mz) return;
mz = t;
if (rz > 1e9) rz = 9;
const tz = ++rz;
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"host_permissions": [
"https://www.youtube.com/*"
],
"version": "4.71.0",
"version": "4.71.1",
"web_accessible_resources": [{
"resources": ["images/*.png", "js/injection*.js", "js/content.js", "css/style_*.css"],
"matches": ["https://www.youtube.com/*"]
Expand Down
2 changes: 1 addition & 1 deletion version.ini
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.71.0
4.71.1

0 comments on commit 4b69a63

Please sign in to comment.