Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

A couple script errors on shots details page #1481

Closed
pdehaan opened this issue Sep 7, 2016 · 9 comments
Closed

A couple script errors on shots details page #1481

pdehaan opened this issue Sep 7, 2016 · 9 comments

Comments

@pdehaan
Copy link
Collaborator

pdehaan commented Sep 7, 2016

https://pageshot.dev.mozaws.net/__version__

{
  source: "https://github.com/mozilla-services/pageshot/",
  description: "Page Shot application server",
  version: "September 07, 2016 21:18:59 UTC",
  commit: "ff447ed",
  contentOrigin: "pageshotcontent.dev.mozaws.net",
  commitLog: "https://github.com/mozilla-services/pageshot/commits/ff447ed"
}

Steps to reproduce:

  1. Go to https://pageshot.dev.mozaws.net/S2hEXUGyma6zrIim/github.com
  2. Open Developer Tools console.

Actual results:

2 errors:

mozilla-services_pageshot

Note, even though the screenshot says "github.com:1", it's actually from https://pageshot.dev.mozaws.net/S2hEXUGyma6zrIim/github.com.

  1. [github.com:1] Refused to load the script 'data:application/javascript;base64,KGZ1bmN0aW9uKCkgewoJLy8gaHR0cHM6Ly9kZXZl…07Cgl9OwoJZ2EucmVtb3ZlID0gbm9vcGZuOwoJd2luZG93W2dhTmFtZV0gPSBnYTsKfSkoKTs=' because it violates the following Content Security Policy directive: "script-src 'self' www.google-analytics.com 'nonce-8e12d036-21bd-42c2-9a3d-dd7dad062c17'".
  2. [raven.js?rev=ff447ed:80] Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
    (client) title="Sep 7 2016, 3pm" data-reactid="1
    (server) title="Sep 7 2016, 10pm" data-reactid="

Also from the screenshot is an odd console info/log of sendEvent( web visit visit undefined ) and stubbed ga( send event web visit visit undefined ). I say "odd" because (a) I'm uneducated and ignorant, and (b) "visit" is twice twice, and (c) has "undefined", which I usually find suspicious.
— Separate bugs available upon request.

@ianb
Copy link
Contributor

ianb commented Sep 8, 2016

Note sendEvent and stubbed ga are fine, just messages about analytics being sent.

I'm guessing the React issue is a timezone issue.

@pdehaan
Copy link
Collaborator Author

pdehaan commented Sep 8, 2016

Note sendEvent and stubbed ga are fine, just messages about analytics being sent.

@ianb : I think the part I found mildly concerning was the undefined in both the pings.

@fzzzy
Copy link
Contributor

fzzzy commented Sep 8, 2016

The undefined is also normal, as there are up to three things that can be specified with a ping, but not all of them have to be specified.

@fzzzy
Copy link
Contributor

fzzzy commented Sep 8, 2016

github.com showing up as the filename is concerning. Maybe we should end every url with <shotid>.html instead, and put the domain towards the beginning of the url?

@ianb
Copy link
Contributor

ianb commented Sep 8, 2016

Eh, github.com is just a guess at the name of the page given its id. It's just funny-looking, it doesn't matter.

But why is there a data URL script? I don't see that error on the page. That all seems very suspicious. Do you have an add-on installed that might be injecting something?

@fzzzy
Copy link
Contributor

fzzzy commented Sep 8, 2016

I think the name does matter, because someone that doesn't know what is going on might assume that we were trying to do something nefarious by posing as github.

The data url might be injected by google analytics.

@ianb
Copy link
Contributor

ianb commented Sep 9, 2016

After a little base64 decoding (surprisingly hard given just a chunk in a screenshot), but apparently it's uBlock: https://www.reddit.com/r/techsupport/comments/3zi5jq/what_does_this_javascript_code_do_and_why_was/

It's acceptable that GA is disabled and this script is not loaded in this case. We only need to make sure the lack of a ga() function doesn't break anything (which it doesn't seem to). Reviewing the code, we have our own window.ga() stub, we don't use Google's, so the stub just sits around when that uBlock script doesn't load.

@ianb
Copy link
Contributor

ianb commented Sep 9, 2016

Thoughts on the timezone: I guess we need to render in UTC, including on the client, then "update" to be local time. I'd rather do that directly in the time component, but I'm not sure quite how. Something with setState? Probably just a bool, then I guess setTimeout(() => this.setState({renderLocalTime: true})) ?

@ianb
Copy link
Contributor

ianb commented Sep 9, 2016

I opened #1500 for the timezone issue, which I think is the only thing left here.

@ianb ianb closed this as completed Sep 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants