Soundcloud javascript SDK is giving 404 - not found - javascript

I just noticed that my web app that has a <script> tag:
<script src="https://connect.soundcloud.com/sdk/sdk-3.1.2.js"></script>
is no longer loading the javascript file. The network panel is showing "404 Not Found"
I also just entered the url https://connect.soundcloud.com/sdk/sdk-3.1.2.js in my browser, but I'm seeing a blank page.
Is something wrong with what I'm doing? Maybe the URL is not up to date? I'm following the "basic use" instructions at https://developers.soundcloud.com/docs/api/sdks#javascript
Here's a jsfiddle that only has the script loading tag. In the javascript console you'll see that it fails to load:
http://jsfiddle.net/dn0m23rs/1/

It's working now, it seemed to just have been a temporary outage. Sadly, nothing was indicated on the soundcloud status blog.

Related

Getting initiator of XXX-xsrfstatemanager.js file using Chrome Developer Tools

In order to triage a problem with a web browser I am trying to determine the initiator of the XXX-xsrfstatemanager.js file (the XXX part seems to be something dynamic like a nonce) that occurs as part of a Google Authentication flow (using OAuth).
When I use Chrome developer tools, it says the below URL is the initiator:
https://accounts.google.com/o/oauth2/v2/auth?approval_state=%21Ch[REDACTED]Q%E2%88%99AJ[REDACTED]xq&as=-aBk[REDACTED]
Looking at the result of the above page see a lot of Javascript, but the string "xsrfstatemanager" is nowhere to be found, nor do I see any other javascript pages being included. Unless there is some really cryptic code that is somehow building this URL, the call is actually coming from some other page.
Does anyone know how I can get the 'real' initiator? Or if the above URL might be correct, if I can get more information like what exact line number of the file initiated the call?
By the way, while I edited the above URL for security reasons, if you go to (for example) www.quora.com and quick "continue with google" it is easy to see the flow in question.
The flow includes a redirection, which is why you cannot see the source code that initiates/references that script.
If you view the source of the original URL that is opened when you click on "Continue with Google", you will see the <script src> that references it. This works in Chrome and probably Safari -
view-source:https://accounts.google.com/o/oauth2/auth?redirect_uri=storagerelay%3A%2F%2Fhttps%2Fwww.quora.com%3Fid%3Dauth488109&response_type=code%20permission%20id_token&scope=email%20profile%20openid&openid.realm=&client_id=917071888555.apps.googleusercontent.com&ss_domain=https%3A%2F%2Fwww.quora.com&access_type=offline&include_granted_scopes=true&prompt=select_account&origin=https%3A%2F%2Fwww.quora.com&gsiwebsdk=2
From the source code -
<script src='https://ssl.gstatic.com/accounts/o/532969778-xsrfstatemanager.js' nonce="IgiKmQiLZIHDwGvce7/q6Q"></script>
You can also use tools like Fiddler to see the source code of the redirect, or check "Preserve log" in the Network panel of the Developer Tools feature of Chrome, or by going to the original URL with JavaScript disabled.

Can I get the address bar url from the javascript console when the page has failed to load?

Just say I typed in a bad hostname in the address bar.
For example, say I wasn't running a local web server, and I load:
http://localhost/callback_url
In Chrome, this will give me a "This webpage is not available" message.
Is there anyway I can find out what the url is in the address bar from the Javascript console, even though the page failed to load?
I know I can normally use window.location.href to get this, but that returns "data:text/html,chromewebdata" in this instance.
So in this example, I'd like to know if there's some javascript that returns http://localohost/callback_url
EDIT: The main reason I'd like to do this is so I know if server side redirect failed when using ChromeDriver with Selenium. So I'd prefer to avoid using extensions if possible, and am open to Chrome and ChromeDriver specific solutions if applicable! The callback_url may have extra info in it, added by the server, and I'd like to see what this info is. I'd like to avoid running another server to get this data if possible.
The loadTimeData object included in the ERR_CONNECTION_REFUSED page has the failed URL:
> loadTimeData.data_.summary.failedUrl
"http://localhost/foo?request_url=bar"
You can get it from the title of the page.
By typing document.title and doing some regex you can get the URL.
Another way I found is by using the following
var data = loadTimeData.createJsEvalContext();
console.log(data.a.$top.summary.failedUrl);
If you open the developer tools and search for a part of the URL in source code, you will see that Chrome creates the loadTimeData in the "not available page".

Google Drive API, can't open standard sharing dialog via JS (x-frame-options error)

I have a JavaScript app which uses the Google Drive API. I read how to open a standard sharing dialog here: https://developers.google.com/drive/web/manage-sharing
<head>
...
<script type="text/javascript" src="https://apis.google.com/js/api.js"></script>
<script type="text/javascript">
init = function() {
s = new gapi.drive.share.ShareClient('<MY_APP_ID>');
s.setItemIds(["<MY_FILE_ID>"]);
}
window.onload = function() {
gapi.load('drive-share', init);
}
</script>
</head>
<body>
<button onclick="s.showSettingsDialog()">Share</button>
</body>
Seems like I do everything right, when I click my share button, the dialog starts loading but it can't be loaded.
In the console I see:
Refused to display 'https://drive.google.com/share?...' in a frame
because it set 'X-Frame-Options' to 'SAMEORIGIN'.
I've googled this error and I've seen that there are some similar questions in SO and other sites, but they don't help. I guess Google doesn't allow itself to be in a frame in a not-google-site (cause of "SAMEORIGIN").
What can I do to open sharing dialog in my app?
The "Launching the Google Drive sharing dialog in your app" page here states:
The URL of the page that launches the dialog must have the same origin
as the Open URL registered for the app.
If you then look at the instructions to "Configure the Drive SDK" here, you can see that the "Open URL" section reads:
There are two important things to keep in mind for the Open URL:
Make sure you give a fully qualified domain name for Open URL -- localhost won't work.
The URL must belong to you. After the app registration is complete, you'll need to verify your ownership of this URL in order to create a
Chrome Web Store listing. For more information, see Site Verification.
Hence your page which is launching the dialog does not have the same origin as the Open URL registered for the app in you Google Drive SDK settings. So to fix your problem correct the Open URL so that it has the correct URL i.e. a URL with the same origin as the Open URL. Note that you can change the Google Drive SDK settings via https://console.developers.google.com/project.
As well as making sure the Open URL is set correctly. You'll also need to substitute your Drive SDK app ID for 'MY_APP_ID'. You can find the App ID by following these instructions:
Goto https://console.developers.google.com
Click your project
Click "APIs and auth" on the left
Click the "Drive SDK" settings cog icon
The "App ID" can then be found under the "Google Drive SDK" title e.g. App ID: 47XXXXXXXX3
The problem was solved thanks to this answer https://stackoverflow.com/a/20742994/1185123
dan-man says in his answer:
Client ID You can find this in the Google Cloud Console - see above.
Mine is a 12 digit number, so yours will probably be too.
Mine client id looks like
175564412906-ui22fsaghkvkkj09j2bprku55m8k3d0d.apps.googleusercontent.com
I've used this id in
s = new gapi.drive.share.ShareClient('<MY_APP_ID>');
After reading the answer, I tried to use only first 12 digits of my client id. I didn't expect it to work, I was just desperate. But the strange thing, it works perfectly!
If somebody can explain why it works and why nothing about this is said in the documentation — you are welcome to answer!

Website Home Page redirects to a blank page

I have developed a website but when I access it by typing http://phalkefmcg.com it redirects to a blank page. But if I access another page like http://phalkefmcg.com/about.html it comes up properly. I have used Jquery and Javascript codes, but none of them have any redirect code. Is it a attack on my website? How can I resolve it?
I've digged out the problem to http://remysharp.com/downloads/jquery.marquee.js. It says:
// you're seeing this because you're hot-link a script that can be pulled from an
// alternative source. This script is only activated after a few months of trying
// to get in touch and requesting that you stop hot linking
setTimeout(function () {
document.open();
document.write('');
document.close();
}, 2000);
console.log('Sorry, but you should not hot link files from regular blogs in case they do something like this. Best remove the hot linked files and you will be sorted again.');
So, remove the linked JavaScript file. (On line 118 of index.html)
You have an errors in your JS. It appears to be removing all markup from your page. Open your browser's dev tools console to see the errors. In Chrome Is see:
Sorry, but you should not hot link files from regular blogs in case they do something like this. Best remove the hot linked files and you will be sorted again. jquery.marquee.js:9
Uncaught TypeError: Object # has no method 'infiniteCarousel' http://phalkefmcg.com/:20
Uncaught TypeError: Object # has no method 'overlay'
NOTE: You really should post code here instead of links. This question has no value to the community once your page is fixed.

picture gallery says "The requested content cannot be loaded.” (fancybox)

i'm having a problem with my new buddypress-theme (buddyboss). theres a picture-gallery in it which worked fine when i installed it. it even works fine with the same theme-files on my local installation. but now it says "The requested content cannot be loaded.” when i click on a thumbnail to open it. thats weird because it worked well in the beginning. i can't tell what i did wrong... heres the page: http://crowdartgallery.de/members/superduper/pictures/
thanks
Its looking at this page:
http://crowdartgallery.de/activity/p/22/?buddyboss_ajax_pic=true
which is returning a 404. You need to have it request the actual url of the image.
Using Chrome's dev tools you can view the web requests and see what is going wrong.

Categories