Code Monkey home page Code Monkey logo

Comments (4)

SuperManifolds avatar SuperManifolds commented on August 24, 2024

This has already been resolved in 3d12b80
But my current way of doing it is undesirable and I never even considered popstate. I will look into using this instead of relaying on an interval

from alientube.

SuperManifolds avatar SuperManifolds commented on August 24, 2024

The popstate is not being fired nor is the history being manipulated. Are you sure YouTube is even doing this?

from alientube.

YoshiWalsh avatar YoshiWalsh commented on August 24, 2024

Hmm, I can't think of any other way that YouTube would modify the page address without triggering a reload... I will investigate.

from alientube.

YoshiWalsh avatar YoshiWalsh commented on August 24, 2024

I'm not used to doing this sort of thing so I could be wrong, but it appears that the ytbuffer object is responsible for these pageloads. I found the following code which appears to manage the queue, but I can't find the code that actually does the page loading.

var lg = function () {
var a = window.ytbuffer;
if (a) {
if (a = a.bufferedClick) {
window.document.removeEventListener ? window.document.removeEventListener("click", window.ytbuffer.handleClick, !1) : window.document.detachEvent("onclick", window.ytbuffer.handleClick);
var b = (0, m.N)("yt-is-buffered");
(0, m.A)(b, function (a) {
(0, m.M)(a, "yt-is-buffered")
});
(0, m.kg)(a.target || a.srcElement, "click");
(0, m.Ff)("buffer_click", (0, m.Af)({
page_name: (0, m.v)("PAGE_NAME")
}))
}(0, m.Wc)("ytbuffer")
}
};

(0, m.Ba)() ? this.b.push((0, m.Da)(Sk)) : Sk();
(0, m.Ba)() ? this.b.push((0, m.Da)(Yr, 200)) : Yr();
(0, m.Ba)() ? this.b.push((0, m.Da)(m.un)) : (0, m.un)();
try {
if (window.ytbuffer && window.ytbuffer.queue) {
for (var e = window.ytbuffer.queue, a = 0; 5 > a && a < e.length; a++) {
var g = e[a],
h = g.target || g.srcElement;
(0, m.Hf)((0, m.Af)({
a: "buffer_events",
event_index: a,
clientX: g.clientX,
clientY: g.clientY,
localName: h.localName,
className: h.className,
id: h.id,
page_name: (0, m.v)("PAGE_NAME")
}))
}
window.document.removeEventListener ? window.document.removeEventListener("click",
window.ytbuffer.enqueueEvent, !1) : window.document.detachEvent("onclick", window.ytbuffer.enqueueEvent);
(0, m.Wc)("ytbuffer")
}
} catch (k) {}

try {
var ytbuffer = {};
ytbuffer.bufferedClick;
ytbuffer.handleClick = function (e) {
var element = e.target || e.srcElement;
while (element.parentElement) {
if (element.className.match(/^yt-can-buffer$|^yt-can-buffer | yt-can-buffer$| yt-can-buffer /)) {
ytbuffer.bufferedClick = e;
element.className += ' yt-is-buffered';
break;
}
element = element.parentElement;
}
};
if (document.addEventListener) {
document.addEventListener('click', ytbuffer.handleClick);
} else {
document.attachEvent('onclick', ytbuffer.handleClick);
}
} catch (e) {}

from alientube.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.