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

Some nasty redirect in a client-side script #2

Closed
peterbe opened this issue Mar 31, 2014 · 12 comments
Closed

Some nasty redirect in a client-side script #2

peterbe opened this issue Mar 31, 2014 · 12 comments
Milestone

Comments

@peterbe
Copy link

peterbe commented Mar 31, 2014

URL: https://console.aws.amazon.com/cloudfront/home
Browser: Firefox
Version: 30.0a2
Problem type: Looks like the website has a bug.
Site owner: No

Steps to Reproduce
Hopefully this short video explains it well enough
http://people.mozilla.org/~pbengtsson/Screencast_2014_03_31_11_20_29.mov

@miketaylr
Copy link
Member

Just tried to look into this--unfortunately I don't have an AWS account. Trying to create a test account requires a credit card...

Could someone with an account go to the problematic page in question and save the page (File > Save Page As... All files), zip that up and toss it somewhere publicly accessible? That would help a lot.

@peterbe
Copy link
Author

peterbe commented May 12, 2014

I can save the HTML but that's not reproducible. The main bulk of the page (all the icons) is loaded in with AJAX on page load.

Skimming through the HTML source, I see

(function() {
    ...
        window.onload = function(){
            waitForLoad = false;
            navCss = createElement('csem-nav-css-indicator');
            appCss = createElement('csem-app-css-indicator');
            reportErrors();
        };
})()

That waitForLoad looks suspicious. Also, if the following .js files tries to attach itself to window.onload there might be a bug because this code (mentioned above) hijacks window.onload. Basically if you have

window.onload = function() { console.log('A') }
window.onload = function() { console.log('B') }

it will only ever print out B on the console. Perhaps their code is expecting more from window.onload.

@peterbe
Copy link
Author

peterbe commented May 12, 2014

Twitter shaming

@miketaylr
Copy link
Member

Thx @peterbe, looks like I need to actually sign up to be able to debug this further.

@hallvors
Copy link

I can save the HTML but that's not reproducible

@peterbe what if you copy the code from "View source" to an editor and save it? With some luck, just adding a BASE HREF tag might give you a page that loads the relevant JS - the AJAX calls will quite likely fail, but we might get enough details to investigate the onload mechanics.

@peterbe
Copy link
Author

peterbe commented May 13, 2014

I did that. Fortunately all CSS and Javascript is referenced to their CDN with an absolute URL.
https://www.dropbox.com/s/t3mrg3fuxyit5x4/home.htm
Unfortunately it's not happening when opening this link locally :(

@hallvors
Copy link

Intriguing..! Almost like something that breaks when you load it locally causes the problem?!

@peterbe
Copy link
Author

peterbe commented May 16, 2014

It's happening on this page too
http://blogs.aws.amazon.com/application-management/post/Tx1ZLAHMVBEDCOC/Dockerizing-a-Python-Web-App

At least for me. It's constantly reloading itself.

@hallvors
Copy link

Works for me (when not logged in)

Peter, can we talk on IRC or something?

@peterbe
Copy link
Author

peterbe commented May 16, 2014

I'm peterbe on irc. You'll find me in #webdev

@karlcow
Copy link
Member

karlcow commented Dec 26, 2014

@hallvors @peterbe Is this still going on? Did you talk?
What is the next step?

@peterbe
Copy link
Author

peterbe commented Dec 28, 2014

May 16 was a very different time in an actively maintained project. I'd consider this closed. Please correct me if it's still a problem.

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

5 participants