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

www.dailymotion.com - see bug description #793

Closed
nikhilm opened this Issue Mar 16, 2015 · 7 comments

Comments

Projects
None yet
6 participants
@nikhilm
Copy link

nikhilm commented Mar 16, 2015

URL: http://www.dailymotion.com/video/x29cppa_awesome-public-toilet-in-japan_creation
Browser / Version: Firefox 39.0
Operating System: All
Problem type: Something else - I'll add details below

Steps to Reproduce
Please see gecko bug https://bugzilla.mozilla.org/show_bug.cgi?id=1143306

  1. Navigate to: http://www.dailymotion.com/video/x29cppa_awesome-public-toilet-in-japan_creation
  2. As can be seen in the Gecko bug screenshot, the comments and sidebar does not load.

Expected Behavior: comments and sidebar should load
Actual Behavior: do not load

The reason is that the Fetch API (enabled in Fx 39 and Cr 42) introduces a Request interface on window. DailyMotion is defining it's own Request interface with different methods, but it does not declare them if 'Request' already exists on window. It then tries to call these methods. Easiest fix would be for them to always declare their Request, or rename it.

@miketaylr

This comment has been minimized.

Copy link
Member

miketaylr commented Mar 17, 2015

Thanks for the analysis @nikhilm. This also affects Chrome.

@miketaylr

This comment has been minimized.

Copy link
Member

miketaylr commented Mar 17, 2015

Uncaught TypeError: Request.getHashParams is not a function

Here's where they're piling onto the built-in, from http://static1.dmcdn.net/js/build/common.f2912b972aeac4c69c5c.js:

function(e, t, n) {
    n(1), n(2), _DM.define("Request", function() {
      var e = {getRequestURI: function(e) {
          return e && !/^(http:|https:)?\/\//.test(e) ? e : "/" + (e || document.location.href).split(/[\/]+/).slice(2).join("/")
        },redirect: function(e) {
          document.location.href = e
        },redirectAfterTimeout: function(e, t) {
          setTimeout(function() {
            Request.redirect(e)
          }, 1e3 * t)
        },getFirstToken: function(t) {
          return e.getRequestURI(t).split(/[\/]+/)[0]
        },getLastToken: function(t) {
          var n = e.getRequestURI(t).split(/[\/]+/);
          return n[n.length - 1]
        },getAnchor: function(t) {
          var n = e.getRequestURI(t).match(/#(.*)$/);
          return n ? n[1] : null
        },getQueryParams: function(e) {
          var t = -1 !== e.indexOf("?") ? e.replace(/^\s+/, "").replace(/\s+$/, "").match(/([^?#]*)(#.*)?$/) : null, n = {};
          return t ? ($.map(t[1].split("&"), function(e) {
            if ((e = e.split("="))[0]) {
              var t = decodeURIComponent(e.shift()), i = e.length > 1 ? e.join("=") : e[0];
              i !== window.__undefined && (i = decodeURIComponent(i)), t in n ? ($.isArray(n[t]) || (n[t] = [n[t]]), n[t].push(i)) : n[t] = i
            }
          }), n) : n
        },getHashParams: function() {
          var e = {}, t = window.location.hash.replace(/#/g, "");
          return t ? ($.map(t.split("&"), function(t) {
            if ((t = t.split("="))[0]) {
              var n = decodeURIComponent(t.shift()), i = t.length > 1 ? t.join("=") : t[0];
              i !== window.__undefined && (i = decodeURIComponent(i)), n in e ? ($.isArray(e[n]) || (e[n] = [e[n]]), e[n].push(i)) : e[n] = i
            }
          }), e) : e
        },cleanSearch: function(e) {
          return e.replace(/\/|~/g, " ").replace(/^(\.*)$/, " $1")
        }};
      return e
    }, !0)

The simplest thing would be to probably rename this from _DM.define("Request" to _DM.define("DMRequest" (or whatever).

@miketaylr

This comment has been minimized.

Copy link
Member

miketaylr commented Mar 17, 2015

I believe @karlcow has contacts at Daily Motion. Setting as contactready.

@dharFr

This comment has been minimized.

Copy link

dharFr commented Mar 18, 2015

Hi there,
Dailymotion team member here. The issue has been reported internally a few days ago. A fix should be released in production very soon. I forwarded this issue to the team anyway, we'll drop a line once the fix will be released.
Thanks for spotting this.

@inside

This comment has been minimized.

Copy link

inside commented Mar 23, 2015

Hi,

Also Dailymotion team member here, thanks for reporting this. The fix has been pushed to prod. Let us know if you're still having this error.

Regards,

@karlcow

This comment has been minimized.

Copy link
Contributor

karlcow commented Mar 23, 2015

Checked and Fixed!
Thanks a lot all of you.
http://twitter.com/webcompat/status/579936348154384384

@karlcow karlcow added the fixed label Mar 23, 2015

@karlcow karlcow closed this Mar 23, 2015

@dharFr

This comment has been minimized.

Copy link

dharFr commented Mar 23, 2015

You're welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.