토론 » 개발

YouTube userscript - charging without refreshing the page.

§
게시: 2014-11-08
수정: 2014-11-10

YouTube userscript - charging without refreshing the page.

https://github.com/look997/PNYT

Code
https://github.com/look997/PNYT/blob/master/pnyt.user.js

I have a small script to YouTube.

The problem started since the videos load without refreshing the page.

popstate event is not enough - it works only when the back / forward-button.

The "setTOFun ()" should be performed each time you charge the new film.


How to do it?

§
게시: 2014-11-10

You can use a Mutation Observer to watch for changes in the page. Here is an example:

https://greasyforks.org/en/scripts/4346-youtube-remove-list-from-watch-urls/code

On line 32, call your script to parse through the list of added nodes.

답글 게시

답글을 게시하려면 로그인하세요.

长期地址
遇到问题?请前往 GitHub 提 Issues。