Reputation: 3002
I want to redirect the link from facebook.com/abcdef
to m.facebook.com/abcdef
via userscript.
Using:
window.location.replace("https://m.facebook.com");
does not go to m.facebook.com/abcdef
window.location.replace(window.location.href.replace('https://', 'https://m.'));
does, but the page keeps loading that I can't scroll down to read without disruption.
Upvotes: 0
Views: 437
Reputation: 6682
Most likely the meta include rules of your user script match https://m.facebook.*
as well. Thus the user script is started after every redirection again.
Just exclude https://m.facebook.*
from your rules or use a more specific needle in your invocation of the replace
method, e.g. replace 'https://facebook.'
by 'https://m.facebook.'
.
Upvotes: 1