Greasy Fork is available in English.

게시판 » 개발

Dear Bro. How to have a page refresh after 10 sec that it has finished loading? Just once.

§
작성: 2022-09-26

Dear Bro.

How to have a page refresh after 10 sec that it has finished loading? Just once.

setTimeout(function(){
location.reload();
},10000);

This will result in 1 refresh every 10 seconds, and I only need to refresh twice in total.
That is to say, the automatic refresh of an open page is once, followed by another 10 seconds later.

§
작성: 2022-09-27

That script loads again every time the page is loaded, so it makes it run in a loop.
You need to create a local storage or local session variable and check the value, then erase that value every x seconds for example.
You could also instead check for that variable value using tampermonkey storage.

§
작성: 2022-09-27

My bro. Could you help me to achieve complete script? Good man.

// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author hacker09
// @match http://*/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Your code here...
})();

§
작성: 2022-09-27

I currently don't have time available for anything.

댓글 남기기

댓글을 남기려면 로그인하세요.