No Meta Refresh

By Pirateshark Last update Mar 20, 2006 — Installed 1,258 times.

Archived Comments (locked)

in
Subscribe to Archived Comments 9 posts, 6 voices



Jesse Andrews Admin

The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008)

 
Lucza Gyuri Scriptwright

http://userscripts.org/scripts/show/5506

 
n0nick Scriptwright

I just had to have this script useful so I did this: http://userscripts.org/scripts/show/4097
I simply duplicated the code for each of the cases: refresh, Refresh, REFRESH.

 
Pirateshark Script's Author

It turns out that Firefox doesn't support the lower-case() function of xpath, so I used the trasnlate function.

The script should work on all pages now (regardless of capitalization in 'refresh'). If anybody finds differently, let me know.

@Wulf: when you install the script you should get a dialog that allows you to include and exclude websites. By adding sites to these lists, you can make it only work on a list of websites. The default is for all sites, but you can change that.

 
Wulf User

Is there any way to get this to only work on one (or a list of) website(s)?

Thanks

 
Webb Scriptwright

I don't know enough about the code to interpret your first comment. Makes sense now, though. A modified version works at drudgereport. I'll just use 2 different versions for now.

 
Pirateshark Script's Author
Yes, this is a known problem that I documented in my comment. The issue is that being html, the 'refresh' tag can have any capitalization. I left it as 'Refresh' because that is what nytimes.com uses, whereas drudgereport.com uses 'refresh'. Using the lower-case() function is crashing my javascript whatever, with the error code in the comment below.
If you want it to work for the drudgereport.com you can change the capitalization of refresh on the line:
var refresh = document.evaluate("//meta[@http-equiv='Refresh']",
in the source.
When I get a chance, I will look into this error and hopefully it will be useful on any site.
 
Webb Scriptwright

This is a great idea but it doesn't work. DrudgeReport.com, which refreshes every 200 seconds, ignored it.

 
Pirateshark Script's Author

This script has been tested (briefly) and works in windows and linux for the nytimes.com. However, my javascript interpreter has been crashing when I try to use the lower-case() (or upper-case()) function to make this viable for all sites.

The error is:

Error: Component returned failure code: 0x8060000e [nsIDOMXPathEvaluator.evaluate]
Source File: nometarefresh.user.js
Line: 337
Source Code: 337

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel