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

womenshealthmag.com - see bug description #1267

Closed
webcompat-bot opened this issue Jun 17, 2015 · 8 comments
Closed

womenshealthmag.com - see bug description #1267

webcompat-bot opened this issue Jun 17, 2015 · 8 comments

Comments

@webcompat-bot
Copy link

URL: http://www.womenshealthmag.com/sex-and-relationships/8-sex-habits-of-super-happy-couples
Browser / Version: Firefox Mobile 41.0
Operating System: Android
Problem type: Something else - I'll add details below

Steps to Reproduce

  1. Navigate to: http://www.womenshealthmag.com/sex-and-relationships/8-sex-habits-of-super-happy-couples
  2. …website is not responding.

Expected Behavior:

Actual Behavior:

@miketaylr miketaylr changed the title wyciwyg: - see bug description womenshealthmag.com - see bug description Jun 17, 2015
@miketaylr
Copy link
Member

Hm. The site loads for me.

But maybe "website is not responding" means something else? The slideshow does seem super broken.

@karlcow
Copy link
Member

karlcow commented Jun 17, 2015

The slideshow is not working for me (on device).
It exhibits the same type of issues than #1242
Same mobify error messages.

07:59:56.301 An unbalanced tree was written using document.write() causing data from the network to be reparsed. For more information https://developer.mozilla.org/en/Optimizing_Your_Pages_for_Speculative_Parsing 8-sex-habits-of-super-happy-couples:13:0
07:59:57.326 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:80:0
07:59:57.342 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:116:1
07:59:57.582 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:142:1
07:59:57.961 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:368:0
08:00:01.777 SyntaxError: unreachable code after return statement js_efc4dfa4db8281f28eb7e6399e1caa2f.js:19:13091
08:00:01.801 Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead js_efc4dfa4db8281f28eb7e6399e1caa2f.js:2606:0
08:00:03.925 The Components object is deprecated. It will soon be removed. loaded.js:4:0
08:00:04.421 RTCIceServer.url is deprecated! Use urls instead. <unknown>
08:00:08.324 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:683:1
08:00:08.325 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:683:0
08:00:08.326 ReferenceError: Mobify is not defined 8-sex-habits-of-super-happy-couples:683:1
08:00:08.624 The Components object is deprecated. It will soon be removed. loaded.js:4:0
08:00:08.694 RTCIceServer.url is deprecated! Use urls instead. <unknown>
08:00:09.506 SyntaxError: unreachable code after return statement UserWidget:41:12
08:00:14.307 The Components object is deprecated. It will soon be removed. loaded.js:4:0
08:00:14.374 RTCIceServer.url is deprecated! Use urls instead. <unknown>
08:00:16.970 Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead jquery.min.js:1:0
08:00:18.179 Use of getPreventDefault() is deprecated.  Use defaultPrevented instead.

@karlcow
Copy link
Member

karlcow commented Jun 17, 2015

btw this is showing in the console.log whatever it means. The domain is being rewritten after the unbalanced tree error.

-- http://www.womenshealthmag.com/sex-and-relationships/8-sex-habits-of-super-happy-couples
07:59:56.301 An unbalanced tree was written using document.write() causing data from the network to be reparsed. For more information https://developer.mozilla.org/en/Optimizing_Your_Pages_for_Speculative_Parsing
-- wyciwyg://32/http://www.womenshealthmag.com/sex-and-relationships/8-sex-habits-of-super-happy-couples
07:59:57.326 ReferenceError: Mobify is not defined

@karlcow
Copy link
Member

karlcow commented Jun 17, 2015

Maybe this is this sequence which creates the issue.

document.write('<iframe class="feature_ad" id="feature_ad_leaderboard" src="http://ad.doubleclick.net/adi/womenshealth/sexrelationships;kw=;tag=sex;article=8_sex_habits_of_super_happy_couples;topic=;sbtpc=sexhabitsofsuperhappycouples;slot=81x81;page=0;tile=2;sz=81x81;adc=adi;ord=?" width="1" height="1" marginwidth="0" marginheight="0" frameborder="0" scrolling="no">');

if (navigator.userAgent.indexOf("Gecko")==-1) {
  document.write('<script type="text/javascript" id="feature_ad_leaderboard" src="http://ad.doubleclick.net/adj/womenshealth/sexrelationships;kw=;tag=sex;article=8_sex_habits_of_super_happy_couples;topic=;sbtpc=sexhabitsofsuperhappycouples;slot=81x81;page=0;tile=2;sz=81x81;adc=adi;abr=!ie;ord=?"><\/script>');
}
document.write('</iframe>');

Or reduced to its minimum

document.write('<iframe>');

if (navigator.userAgent.indexOf("Gecko")==-1) {
  document.write('<script type="text/javascript"><\/script>');
}
document.write('</iframe>');

When we do that it rewrites the window.location in Gecko to:

wyciwyg://32/http://www.womenshealthmag.com/sex-and-relationships/8-sex-habits-of-super-happy-couples

@hallvors
Copy link

hallvors commented Jul 7, 2015

It's document.write() replacing the document that creates the wyciwyg: URL. This is a bug but should not cause real problems.

If removing the code Karl quotes really makes a difference, perhaps their Mobify is just outdated. (Or, possibly, Mobify's 227 pull request was an incomplete fix). There's a Mobify.api=[1,0] somewhere in the source - if that means Mobify 1.0 it's old indeed. https://bugzilla.mozilla.org/show_bug.cgi?id=923360#c10 and mobify/mobifyjs#227 to some extent explain why a </script> tag written by a script might break Mobify - if the escape gets lost at some point, we might have a problem.

However, I think that's a red herring and the real problem is this script assuming that global variables will survive a document.write():

$ = jQuery = Mobify.$;

When this is run in the document.write()-generated script, Mobify doesn't exist, and hence neither jQuery nor $ get set correctly. That's going to break pretty much everything in a jQuery-based page.

@miketaylr
Copy link
Member

However, I think that's a red herring and the real problem is this script assuming that global variables will survive a document.write():

Yes, we've run into this before. I wrote about it: https://miketaylr.com/posts/2014/08/document-writing-zeptos.html

Unfortunately it's a WebKit quirk (and a bug according to the HTML standard).

@hallvors
Copy link

So, site needs to update Mobify..

@karlcow
Copy link
Member

karlcow commented Feb 15, 2016

this site is working now.

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

No branches or pull requests

4 participants