Greasy Fork is available in English.

Discussions » Development

Script works only on chrome console

§
Posted: 17.03.2022.

I made a script for HBO Max that makes the player full screen when you double click. (By default it only play/pause the video).

It works as intended except for the controls/navigation bar, which is replaced with the stock one. I have tried to fullscreen the bar also but didn't work.

My biggest problem is that the script doesn't work with the extension, but it does in the developer console.

Here is the code

var elem = document.getElementsByClassName("default mtz-vlc-odecb")[0];
$(".default.class1.class4").dblclick(function() {
    elem.requestFullscreen();
});
§
Posted: 17.03.2022.

Most likely because you are not setting the run-at correctly, try run-at end, maybe your script is running before the page finishes loading. You could also try window.onload and even the arrive library function.

§
Posted: 17.03.2022.

Most likely because you are not setting the run-at correctly, try run-at end, maybe your script is running before the page finishes loading. You could also try window.onload and even the arrive library function.

I managed to fix it in the meantime.

The problem is that you have to choose the profile before going into the video and the element was empty, so I had to wait for an attribute to appear.

They use PushState and the pages never reload, that's why I have some trouble implementing the script without refreshing the page.

Post reply

Sign in to post a reply.