回答編集履歴

1

location.href

2018/04/13 13:32

投稿

think49
think49

スコア18164

test CHANGED
@@ -50,4 +50,26 @@
50
50
 
51
51
 
52
52
 
53
+ ### location.href
54
+
55
+
56
+
57
+ 前述の通り、`location.href` は書き換えできず、グローバルオブジェクトに至るまで、上位オブジェクトも書き換え出来ません。
58
+
59
+ 従って、スコープを汚すことが出来なければ、制御不可能と思われます。
60
+
61
+
62
+
63
+ ```JavaScript
64
+
65
+ (function (location) {[
66
+
67
+ // この中では locstion の名前は書き換えられた location を参照する (location から始まらなければ回避可能)
68
+
69
+ }(customLocation)); // 書き換えたlocationを渡す
70
+
71
+ ```
72
+
73
+
74
+
53
75
  Re: gori さん