Redirect loop error when trying to open a txt file on G cloud storage? - google-cloud-storage

I'm trying to view some .txt files on my Google Cloud Storage. But when I click the links, the page goes to a "This webpage has a redirect loop" error on Chrome.
The .txt links were working fine early Dec which is the last time I accessed them, but from then till now something broke.

This can be fixed by clearing your cookies, and it should never happen again in this browser.
If you'd prefer not to clear all of your cookies, you can search for cookies scoped to "storage.cloud.google.com" in Chrome, and clear the "cds" cookies (I suspect you have two - you can actually get by with just clearing the older one, which should be the one whose domain is "storage.cloud.google.com" rather than ".storage.cloud.google.com".

Related

How to debug on Facebook Internal Browser (Mobile)?

I'm developing website with a lot of HTML5 and CSS3 features. I'm also using iframe to embed several content on my website. It works fine if I open it using Chrome/Firefox/Safari mobile browser. However, if I share on facebook (post/page) and I opened it up with Facebook application with Facebook Internal Browser, my website is messed up.
Is there any tools or way to debug on Facebook Browser? Thanks.
This is how you can do the debugging yourself. It's painful, but the only way I've come across so far.
tl;dr Get the Facebook App loading a page on your local server so you can iterate quickly. Then print debug statements directly to the page until you figure out what is going on.
Get a link to a page on your local server that you can access on your mobile device (test in mobile safari that it works). See this to find out your local IP address How do you access a website running on localhost from iPhone browser. It will look something like this
http://192.xxx.1.127:3000/facebook-test
Post that link on your Facebook page (you can make it private so your friends aren't all like WTF?)
Click the posted link in the Facebook mobile App and it will open up in Facebook's mobile browser
Since you don't have a console, you basically need to print debug statements directly to the page so it is visible. Put debug statements all over your code. If your problems are primarily related to CSS, then you can iteratively comment out stuff until you've found the issue(s) or print the relevant CSS attributes using JavaScript. Eg something like (using JQuery)
function debug(str){$('body').append("<br>"+str);}
Quite possibly the most painful part. The Facebook browser caches very aggressively. If you are making changes and nothing has happened, it's because the content is cached. You can sometimes resolve this by updating the URLs, eg /facebook-test-1, /facebook-test-2, or adding dummy parameters eg /facebook-test?dummy=1. But if the changes are in external css or js sheets it sometimes will still cache. To 100% clear the cache, delete the Facebook App from your mobile device and reinstall.
The internal browser the Facebook app uses is essentially a uiWebView. Paul Irish has made a simple iOS app that lets you load any URL into a uiWebView which you then can debug using Safari's Developer Tools.
https://github.com/paulirish/iOS-WebView-App
I found a way how to debug it easier. You will need to install the Ghostlab app (You have a 7-day free trial there, however it's totally worth paying for).
In Ghostlab, add the website address (or a localhost address) you want to debug and start the session.
Ghostlab will generate a link for access.
Copy that link and post it on Facebook (as a private post)
Open the link on mobile and that's it! Ghostlab will identify you once you open that link, and will allow you to debug the page.
For debugging, you will have all the same tools as in the Chrome devtools (how cool is that!). For example, you can tweak CSS and see the changes applied live.
If you want to debug a possible error, you can try to catch it and display it.
Put this at the very top of your code:
window.onerror = function (msg, url, lineNo, columnNo, error) {
var string = msg.toLowerCase();
var substring = "script error";
if (string.indexOf(substring) > -1){
alert('Script Error: See Browser Console for Detail');
} else {
var message = [
'Message: ' + msg,
'URL: ' + url,
'Line: ' + lineNo,
'Column: ' + columnNo,
'Error object: ' + JSON.stringify(error)
].join(' - ');
alert(message);
}
}
(Source: MDN)
This will catch and alert your errors.
Share a link on Facebook (privately), or send yourself a message on Facebook Messenger (easier). To break the cache, create a new URL every time, e.g. by appending a random string to the URL.
Follow the link and see if you can find any errors.
With help of ngrok create temporary http & https adress instead of your ordinary localhost:3000(or other port) and you could run your app on any devices. It is super easy to use.
and as it was written above all other useful information you should write somewhere inside div element (in case of React I recommend to put onClick on that div with force update or other function for getting info, sometimes it helps because JS in FB could be executed erlier than your information appears). Keep in mind that alerts are not reliable, sometimes they are blocked
bonus from ngrok that in console you will see which files was
requested and response code (it will replace lack of network tab)
and about iFrame.If you use it on other domain and you rely on cookies - you should know that facebook in-app browser blocks 3rd party cookies
test on Android and iOS separately because technicaly they use different browsers

Where, exactly channel url is used?

On what browsers or user agents that channel URL is actually used, and what for?
I have no intention of having my site to work on Internet Explorer <= 8 (it is an HTML5 <canvas> game, and I am serving everything else as "application/xhtml+xml").
So, if channel is only useful on that old crap, I can gladly get rid of it...
Related (possibly): Channel URL Facebook
Because the social plugin is cross domain call, it needs a way to communicate. The wrokaround is to include a hidden iframe in the page for that. But, with this workaround, that iframe is loaded every time when page loads and will double the traffic reported. This is why channel url was done. What it does, it load the fb js in that page, and from that moment on, the js is available on your domain.
It will improve your loading times (cache) and will fix the reporting issue (you will see in reports channel page reported separately). But is not necessary for any html5 capable browser.
So, if you are using only HTML5 capable browsers, you are safe to ignore that. I am not sure about ie9, I will try to test it with my app by removing channel url and let you know.
Edit: By removing the channel URL from my app, I start getting double traffic reports from IE9. I think that is a good idea to keep the file there, is is just a simple html file with a single line. Better to be safe than sorry.

Site results redirect to Google

A site I'm working on has been hacked. The CMS (which I didn't build) was accessed and some files (e.g. "km2jk4.php.jpg") were uploaded in image fields. I have since deleted them (a week ago). Now, when I search for the site on Google, then click the result, it either:
a) simply redirects me to the Google search page
OR
b) a download dialogue appears asking me to download a zip file, with the source domain something like gb.celebritytravelnetwork.com
Clearly the site's been compromised. But if I simply type the URL in the address bar, the site loads fine. This only happens when I click through Google results.
There is no .htaccess file on the server, and this is not a virus on my computer, since many other people have reported the same thing happening, so this question is not relevant.
Any ideas please?
Thanks.
Your Source files have been changed.
Check all the files included in the index page. They might be header , footer pages.
And try using : fetch as google bot.

Request bot to reparse robots.txt

I am writing a proxy server that maps youtube.com to another domain (so users can easily access youtube from countries like Germany without search results and videos being censored).
Unfortunately there was a bug in my robots.txt. Its fixed now, but Baiduspider got my old robots.txt and has been trying to index the whole website for a couple of days.
Because Youtube is a quite big website, I don't think this process will end soon :-)
I already tried redirecting baiduspider to another page and sending it a 404, but it already parsed to many paths.
What can I do about this?
Stop processing requests from Baiduspider
with lighttpd append to lighttpd.conf
$HTTP["useragent"] =~ "Baiduspider" {url.access-deny = ( "" )}
sooner or later Baiduspider should refetch the robots.txt
(see http://blog.bauani.org/2008/10/baiduspider-spider-english-faq.html)

Creating a new facebook application, no signed request is being sent through. Old app works

I have just created a new facebook application to use in a page tab. When I check for the signed_request it is empty.
So I checked another app that I have done in the past. It is on the same server and the only difference in the setup is the dir name.
http://example.com/app1/ works
and
http://example.com/app2/ doesn't
So I tried swapping the tab URLs in the apps over and app1 still works with app2s URL.
This lead me to believe there must be a problem with the way I have set up the application.
So I went through all the settings and made sure they were the same. They all are, except there are 2 that are not available on the app I just setup. They are "Encrypted Access Token" and "Requests 2.0 efficient" neither of which seem to relate to the problem.
I seem to remember in the past there was an option to pass through the signed request to canvas page, but I can no longer find it.
Has signed request been deprecated? I couldn't see any mention of that in the docs.
Any help/comment appreciated. Otherwise I am going to have to go back and re-use old apps with new content in them, and I only have about 15 more before I run out.
Cheers
Alex
No, it wasn't deprecated.
There can be 2 issues that could cause this
You must have a trailing slash or a specific file on your page tab url.
http://myapp.com/app/
http://myapp.com/app/index.php
Your server for the second app is redirecting the request which causes it to lose the POST variables.
You should check if there aren't any redirects which usually occur form mod_rewrite. (.htaccess and such)
This seems to have been resolved now, I can no longer replicate it with new applications.