P
P
privet772014-09-06 16:39:01
JavaScript
privet77, 2014-09-06 16:39:01

How to make custom script work in browser?

There is a Chrome browser and there is a script:

// ==UserScript==
// @include http://toster.ru/q/128139
// @exclude file://*
// @grant none
// ==/UserScript==

 
var reload_interval = 5000;
function xxx() {
    window.setTimeout(ReloadPage, reload_interval);
}
function ReloadPage() {
  window.location.reload();
}
(function($){
  xxx();
})(jQuery)

The script refreshes the page every five seconds.
The script runs in TemperMonkey in chrome or GreaceMonkey in Mozilla.
I know, at least read that such a custom script can be run in the browser without using an additional application (Tempermonley or GraceMonkey), but directly in the browser. But I can't figure out how to do it. Can you please tell me how to run the script in the browser without additional extensions?
And another question. Given that the extra extension eats up memory and, as I imagine, the extension is run first, then the script is run, is there any speed gain in running the script from the browser itself without using an additional application to run the script? At least for one millisecond.
PS I tried to do it in accordance with this instruction habrahabr.ru/post/150693/, but it doesn't work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
privet77, 2014-09-06
@privet77

@Aingis it is.
@Aingis removed jQuery and still doesn't work. Only in TemperMonkey.
I called the script xxx.user.js, although it was called that way before.
Moved to extensions. It is displayed there. The page is not updating.
This is what it looks like without jQuery now:

// ==UserScript==
// @include http://toster.ru/q/128139
// @exclude file://*
// @grant none
// ==/UserScript==

 
var reload_interval = 5000;
function xxx() {
    window.setTimeout(ReloadPage, reload_interval);
}
function ReloadPage() {
  window.location.reload();
}
(function($){
  xxx();
})

N
nullsesion, 2014-11-13
@nullsession

try making a bookmarklet

<a href="javascript:void( setTimeout(function(){  location.reload() }, 5000) )">0000</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question