[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / wiki / git ] [ GET / ref / marx / booru / zine ]

/tech/ - Technology

"Technology reveals the active relation of man to nature" - Karl Marx
Name
Options
Subject
Comment
Flag
File
Embed
Password (For file deletion.)

Join our Matrix Chat <=> IRC: #leftypol on Rizon


File: 1678558606525.jpg (9.77 KB, 250x187, 1459715943447s.jpg)

 No.18755

sup leftypol. so i have this simple script in Greasemonkey that i use for redirection

// @run-at   document-start

switch(location.hostname) {
case "www.example.com":
  	location.hostname = "www.example.mirror"
 break;


now sometimes i can't connect to example.com and get hit with a "The connection has timed out" page. now the problem is GM doesn't work in such pages. is there anything i can do? doesn't need to be js specific, i don't mind changing stuff in /host. i use firefox btw

 No.18756


 No.18757

>>18756
Sure OP could just use a dedicated plugin, but there's something neat about doing with a user script, and I imagine it takes less memory.

 No.18758

>>18757
and if OPs savvy enough, they can code dive and see how the plugin handles redirection

 No.18759

>>18756
hi, it works fine but for some reason it takes a lot of time to redirect especially if the url is long. not really important for me but it's kinda bloated
>>18758
nope :(

 No.18760

>>18755
billions must mayonaise

 No.18761

Instead of a redirect in some cases why not text replace the URL in links before it even takes you anywhere? Then you won't have to be redirected.

 No.18762

>>18761
sometimes I open a lotta links and it's annoying to edit 20 urls plus my internet is slow and I don't want to wait for things to reload again

 No.18763

>>18761
and you can't always directly edit them, you have to copy them(which is sometimes challenging eg google images) and open them in another tab

 No.18764

>>18755
might be a limitation of userscripts to only load if a page is valid. you might want to look at making a small extension and use the browser api to update the tab url
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/update#examples

 No.18765

>>18764
hmmm will check it tomorrow


Unique IPs: 6

[Return][Go to top] [Catalog] | [Home][Post a Reply]
Delete Post [ ]
[ home / rules / faq ] [ overboard / sfw / alt ] [ leftypol / siberia / hobby / tech / edu / games / anime / music / draw / AKM ] [ meta / roulette ] [ cytube / wiki / git ] [ GET / ref / marx / booru / zine ]