-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use main window window.history #444
base: master
Are you sure you want to change the base?
Conversation
I'll defer to @nicksay but I think the iframe was used to get a clean copy of the web APIs that may have been mangled (accidentally or otherwise) in the global scope of the window by other libraries. |
@@ -41,7 +41,8 @@ spf.config.defaults = { | |||
'navigate-lifetime': 24 * 60 * 60 * 1000, // 1 day session lifetime (ms). | |||
'reload-identifier': null, // Always a param, no '?' needed. | |||
'request-timeout': 0, // No request timeout. | |||
'url-identifier': '?spf=__type__' | |||
'url-identifier': '?spf=__type__', | |||
'use-iframe': true | |||
}; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello
} | ||
return /** @type {!HTMLIFrameElement} */ (frame); | ||
|
||
return /** @type {!Window} */ (frame); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -47,7 +47,7 @@ spf.main.init = function(opt_config) { | |||
*/ | |||
spf.main.canInit_ = function() { | |||
return !!(typeof window.history.pushState == 'function' || | |||
spf.history.getIframe().contentWindow.history.pushState); | |||
spf.history.getIframe().history.pushState); | |||
}; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah
no |
I've added an option to use window.history instead of iframe history.
This is needed by google tag manager & facebook pixel, they overload some method window.history method in order to track new change.
Without this options, these pixel are unusable with spf application
To be honest, I don't understand the reason of using an iframe 😄