Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Option to use main window window.history #444

wants to merge 2 commits into from

Conversation

tchiotludo
Copy link
Contributor

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 😄

@rviscomi
Copy link
Member

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
};


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm

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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ff

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);
};


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah

@zz22zz222
Copy link

no

@undefined123456

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants