|
@@ -1 +1,31 @@
|
|
|
-console.log('content_iframe', window.location)
|
|
|
+console.log('content_iframe', window.location)
|
|
|
+
|
|
|
+const _historyWrap = function (type) {
|
|
|
+ const orig = history[type];
|
|
|
+ const e = new Event(type);
|
|
|
+ return function () {
|
|
|
+ const rv = orig.apply(this, arguments);
|
|
|
+ e.arguments = arguments
|
|
|
+ window.dispatchEvent(e)
|
|
|
+ return rv
|
|
|
+ }
|
|
|
+}
|
|
|
+history.pushState = _historyWrap('pushState')
|
|
|
+history.replaceState = _historyWrap('replaceState')
|
|
|
+
|
|
|
+
|
|
|
+window.addEventListener('hashchange', function (event) {
|
|
|
+ console.log('hashchange', event)
|
|
|
+})
|
|
|
+
|
|
|
+window.addEventListener('popstate', function (event) {
|
|
|
+ console.log('popstate', event)
|
|
|
+})
|
|
|
+
|
|
|
+window.addEventListener('pushState', function (e) {
|
|
|
+ console.log('change pushState', e)
|
|
|
+})
|
|
|
+
|
|
|
+window.addEventListener('replaceState', function (e) {
|
|
|
+ console.log('change replaceState', e)
|
|
|
+})
|