SoFunction
Updated on 2025-04-09

Rewriting and determining whether the location has been rewritten

In IE, it can be rewritten without redirection. The specific method is: var location = {}, and then the specific attributes can be rewrite, which will bring certain risks to judging location through js.
How to tell if the location has been rewritten? After a whole afternoon, I tried a way out:

(location==&&location instanceof Location)

This method is only used in IE.