Skip to content

Commit

Permalink
v4.73.13
Browse files Browse the repository at this point in the history
* Simplified Implementation for `urlChanged66`
  • Loading branch information
cyfung1031 committed Jul 5, 2024
1 parent c964eaa commit 3a42cbb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 48 deletions.
54 changes: 8 additions & 46 deletions js/injection_script_1.js
Original file line number Diff line number Diff line change
Expand Up @@ -1786,37 +1786,6 @@ function injection_script_1() {
if (typeof cProto.__$$urlChanged$$__ === 'function') console.warn('__$$urlChanged$$__ is already defined in ytd-live-chat-frame.');
if (typeof cProto.urlChanged !== 'function' || cProto.urlChanged.length !== 0) console.warn('urlChanged cannot be altered');

// if (typeof cProto.attached === 'function' && !cProto.attached66) {

// cProto.attached66 = cProto.attached;
// cProto.attached = function () {
// const r = this.attached66();
// this.urlChangedIO(); // Tabview Youtube only
// return r;
// }
// }


// let atb = 0;
// cProto.urlChangedIO = async function () {

// console.log('[tyt.chat] urlChangedIO')
// if (atb > 1e9) atb = 9;
// const t = ++atb;

// const chatframe = this.chatframe || (this.$ || 0).chatframe || 0;
// if (!chatframe) return;
// await Promise.resolve();
// if (t !== atb) return;

// await getDMPromise();
// if (t !== atb) return;
// await getDMPromise();
// if (t !== atb) return;
// this.urlChanged();

// }

if (typeof cProto.urlChanged === 'function' && !cProto.urlChanged66 && !cProto.urlChangedAsync12) {

cProto.urlChanged66 = cProto.urlChanged;
Expand All @@ -1825,27 +1794,20 @@ function injection_script_1() {
if (ath > 1e9) ath = 9;
const t = ++ath;
const chatframe = this.chatframe || (this.$ || 0).chatframe || 0;
if (chatframe.contentDocument === null) await Promise.resolve();
if (t !== ath) return;
await getDMPromise();
if (t !== ath) return;
if (chatframe) {
if (chatframe.contentDocument === null) await Promise.resolve();
if (t !== ath) return;
let win = chatframe.contentWindow;
win && await new Promise(r => win.setTimeout(r));
win = null;
if (t !== ath) return;
}
this.urlChanged66();
}
cProto.urlChanged = function () {
this.urlChangedAsync12();
}

/*
await new Promise(resolve => {
io = new IntersectionObserver(resolve, { root: null, threshold: [0.05, 0.95], rootMargin: '0px' });
io.observe(chatframe);
});
io.disconnect();
io.takeRecords();
io = null;
*/

}

cProto.__$$urlChanged$$__ = cProto.urlChanged;
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.73.12",
"version": "4.73.13",
"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.73.12
4.73.13

0 comments on commit 3a42cbb

Please sign in to comment.