Youtube Auto Quick Buffer

Quickens the bufferer on all Youtube videos

< Feedback on Youtube Auto Quick Buffer

Review: Bad - script does not work

§
Posted: 2017-05-30

Not working

Not working anymore.

§
Posted: 2017-05-30

Oh, is it not showing "&gl=CA" at the end of the URL?

Thanks,
Daniel.

§
Posted: 2017-05-30

No it is not showing.

§
Posted: 2017-05-30

This is very weird, the script is literally 4 lines, it should not fail for you :/ The best I can guess is another script you have installed is somehow messing with this one, if you try having only this script enabled then maybe it will work, but if it does work, that is an unwanted situation. If it does not work, all I can suggest is to make sure Chrome and Tampermonkey are on their latest stable versions (like you are not using a Beta of either and you are not using Chrome Canary). Lastly I would recommend you clear your cache in Chrome, you don't need to clear browsing history or passwords or anything like that, just cache, try that also.

I am sorry you are experiencing this behaviour, I do not believe I can help you past the above suggestions.

Best of luck,
Daniel.

§
Posted: 2017-05-30

Hi again,
I actually noticed that a few scripts relative with youtube which I have installed into Tampermonkey on Chrome sometimes do not run and do not appear on Tampermonkey running scripts panel.Because your script just run one hour ago but when I entered youtube a few minutes later again, it did not run one more time like the other scripts.I reported this issue Tampermonkey forum half an hour ago.I am not sure which causes this issue from Tampermonkey,Chrome,Youtube or another thing.I will report you if I get an information from Tampermonkey forum.Thank you for your attention.

§
Posted: 2017-05-30
Edited: 2017-05-30

I did look through your other script discussions earlier, and found that you were having problems other other YouTube scripts, in one of the discussions you stated that you were using a beta version of Chrome, that was in 2016 though, I believe. If that is the case, a beta version of Tampermonkey may need to be installed to get Tampermonkey working with the beta version of Chrome.

EDIT: I also responded to one of your script requests, the one where you are enquiring about a script to show how many MB a video would be. I do hope my explanation and calculations do help you. If you need any help with anything related to the calculations or how I got those numbers, I'd be happy to explain.

§
Posted: 2017-05-30

Yes I read your reply related with the other request and also replied it.I illuminated after your reply.Thanks.

§
Posted: 2017-05-30

I installed the stable versions of Tampermonkey and Chrome but the case did not change.

§
Posted: 2017-05-30
Edited: 2017-05-30

Does it work if you reload the page (with a youtube video)?

Since youtube uses spf, this script won't always trigger. The problem being that with spf it may look like the url and page change but since it is done with dynamic navigation (only parts of webpage change), Tampermonkey won't be triggered. (Tampermonkey only triggers with static navigation)

I solved this problem with the following listener:

window.addEventListener("spfdone", function(e) { //code })

Keep in mind that you need to add the listener when you browse to youtube. So the include rule should be: // @include https://www.youtube.com/*

Full script:

// ==UserScript==
// @name         Youtube Auto Quick Buffer
// @namespace    http://userscripts.org/users/zackton
// @description  Quickens the bufferer on all Youtube videos
// @match        https://www.youtube.com
// @include      https://www.youtube.com/*
// @grant        none
// @version      1.2
// ==/UserScript==

// reload script on page change using spf events (normal youtube)
window.addEventListener("spfdone", function() {
    main();
});

// reload script on page change using youtube polymer fire events (material youtube)
window.addEventListener("yt-page-data-updated", function() {
    main();
});

main();

function main() {
    if (isPlayerAvailable()) {
        var add = document.URL.indexOf("&gl=CA");
        if (add === -1) {
            window.location = document.URL + "&gl=CA";
        }
    }
}

function isPlayerAvailable() { // true if a youtube video is available ( false if live video)
    return /https:\/\/www\.youtube\.com\/watch\?v=.*/.test(document.location.href) && document.getElementById('live-chat-iframe') === null;
}

Let me know if this fixes your problem.

Edit: This trick doesn't work in material youtube (the new layout) Edit 2: Added listener for Material youtube

§
Posted: 2017-05-30
Edited: 2017-05-30

Hi again,
I just installed the script which you posted to me."&gl=CA" is not appearing at the end of the URL but at least script is running and appearing on the Tampermonkey panel.I guess the issue is solved.

§
Posted: 2017-05-30
I just installed the script which you posted to me."&gl=CA" is not appearing at the end of the URL but at least script is running and appearing on the Tampermonkey panel.I guess the issue is solved.

I think that you are using Material youtube (the new layout), try the updated script.

§
Posted: 2017-05-30
Edited: 2017-05-30

No I am using standard version of Youtube.I installed the latest script supported material which you shared but as I said,"&gl=CA" is not appearing at the end of the URL but at least script is running and appearing on the Tampermonkey panel.

Edit:Thank you Cptmathix it is working perfectly now."&gl=CA" is appearing also.Thanks for everything.My problem is solved.:))

§
Posted: 2017-05-30
No I am using standard version of Youtube.I installed the latest script supported material which you shared but as I said,"&gl=CA" is not appearing at the end of the URL but at least script is running and appearing on the Tampermonkey panel.

Ok, no idea what's causing the problem since we use the exact same Chrome and probably the same Tampermonkey version.

§
Posted: 2017-05-30
Edited: 2017-05-30
No I am using standard version of Youtube.I installed the latest script supported material which you shared but as I said,"&gl=CA" is not appearing at the end of the URL but at least script is running and appearing on the Tampermonkey panel.
Ok, no idea what's causing the problem since we use the exact same Chrome and probably the same Tampermonkey version.

Ok. Thanks for everything.My problem is solved.:)) I edited my message above.

§
Posted: 2017-05-31

Thank you very much, Cptmathix, for your recommendation for improvement, I never did put 2 and 2 together to realise that spf would mess up the script execution when navigating to a new video, when you are currently on a video page. I have given special thanks at the bottom of the script description, hyperlinking your name when referenced :)

§
Posted: 2017-05-31

By the way, the reason Cptmathix's solution wouldn't have worked for mozkan007, is that the script would need to run at document-end to detect the events (I know, it is an event listener, so it should have worked, but it didn't).

§
Posted: 2017-05-31
I have given special thanks at the bottom of the script description, hyperlinking your name when referenced :)

You didn't have to do that, glad to be of help.

By the way, the reason Cptmathix's solution wouldn't have worked for mozkan007, is that the script would need to run at document-end to detect the events (I know, it is an event listener, so it should have worked, but it didn't).

That's really strange... My youtube scripts that use these listeners run at document-start... I'm confused why it doesn't work for some.

Post reply

Sign in to post a reply.