Skip to content

bugfix for Firefox for some ads that use document.write#3524

Merged
jsnellbaker merged 3 commits intoprebid:masterfrom
jarnix:master
Feb 15, 2019
Merged

bugfix for Firefox for some ads that use document.write#3524
jsnellbaker merged 3 commits intoprebid:masterfrom
jarnix:master

Conversation

@jarnix
Copy link
Contributor

@jarnix jarnix commented Feb 6, 2019

Type of change

  • [x ] Bugfix

Description of change

This is a fix targeted for Firefox that creates an entry in history after a document.write. It means that when an ad uses document.write (as we see in a lot of ads on our 30 M users network), the user has to click the "back" button twice to go back. The bug is 17 years old (https://bugzilla.mozilla.org/show_bug.cgi?id=148794) and the workaround is described here for example : https://stackoverflow.com/questions/19624452/workaround-to-firefox-creating-new-history-after-each-document-write/32677679#32677679 .

@jarnix
Copy link
Contributor Author

jarnix commented Feb 6, 2019

I don't understand why the test in Circle CI would be failing and I surely don't want to modify the test. Please, can someone more experienced with the tests of this project can check the code ?

@bretg
Copy link
Contributor

bretg commented Feb 7, 2019

@jarnix - please take a look at the unit tests that are failing due to this change. I would call this a pretty important change that could break even more -- unit tests don't try renders in all browsers.

Please describe the problem you're trying to solve and help us understand why adding doc.open is necessary and safe for other browsers.

@jarnix
Copy link
Contributor Author

jarnix commented Feb 8, 2019

@bretg I agree with you, it's a "pretty important change", that's why I did not want to modify the tests but I got it why the test was failing. The doc.open method was called but not monitored by sinon.spy() so I added it. So now the tests are okay in the CI, but I really would like a human check though..

Copy link
Collaborator

@harpere harpere left a comment

Choose a reason for hiding this comment

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

I think this is fine.

@harpere harpere added needs 2nd review Core module updates require two approvals from the core team and removed needs review labels Feb 14, 2019
@jsnellbaker jsnellbaker self-requested a review February 14, 2019 17:05
Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

LGTM; I tested this change in Chrome and Firefox with banner/outstream type ads as well as using the Universal Creative templates in both safeframe/non-safeframe setups. The ads rendered fine in all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs 2nd review Core module updates require two approvals from the core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments