Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!DOCTYPE html>
Works around G+ 403 errors like these:
403. That’s an error.
Your client does not have permission to get URL /sorry/IndexRedirect?continue= from this server. That’s all we know.
<h1>Work around G+ "403. That’s an error." errors</h1>
<p>Please enter the Google 403 error URL:</p>
<input id="googlePlus403Url">
<button type="button" onclick="decodeGooglePlus403UrlMethod()">Submit</button>
<div id="decodedUrlsCaptionDiv">
<p id="decodedUrlsCaption">Here you will see the decoded Google Plus URLs so you can follow them:</p>
<ul id="decodedUrlsUl">
// based on
function decodeGooglePlus403UrlMethod() {
var googlePlusUrl = "";
var errorText = "";
// Get the value of the input field with id="numb"
var googlePlus403Url = document.getElementById("googlePlus403Url").value;
var stripPrefix = "";
var prefix = stripPrefix + "";
var suffixStart = "&q=";
// now skip anything until the suffixStart, so we kill `CGMSBLzJ3TkY7vzttwUiGQDxp4NL-KfC7ZN3j6E2rFd4pZYndOXSbvYqOWh0dHBzOi8vcGx1cy5nb29nbGUuY29tL3UvMC8rTHluZGFIZWNodC9wb3N0cy9mU1NYaDk2cmNMaQ`
// Am I a SO developer now? At least I'm quickly learning some JavaScript basics...
if (googlePlus403Url.indexOf(prefix) == 0) {
var lastSuffixStartIndex = googlePlus403Url.lastIndexOf(suffixStart);
if (lastSuffixStartIndex == -1) {
errorText = "SuffixStart missing in URL";
} else {
// now strip the bits we don't need, then decode what is left.
// I always wondered why they call it substring instead of subString
var googlePlusEncodedUrl = googlePlus403Url.substring(stripPrefix.length, lastSuffixStartIndex);
// decoding got a new new a while ago:
googlePlusUrl = decodeURIComponent(googlePlusEncodedUrl);
} else {
errorText = "Wrong prefix in URL";
// for now, just add the output; in the future, only add unique output.
// Based on
var decodedUrlsUl = document.getElementById("decodedUrlsUl");
var decodedUrlLi = document.createElement('li');
if (errorText == ""){
var aTag = document.createElement('a');
aTag.setAttribute('href', googlePlusUrl);
aTag.innerHTML = googlePlusUrl;
} else {
var aDiv = document.createElement('div');
aDiv.innerHTML = errorText + " " + googlePlus403Url;

This comment has been minimized.

Copy link
Owner Author

@jpluimers jpluimers commented Aug 18, 2016

Adopt for chrome-extension://klbibkeccnjlkjkiokjodocebajanakg/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment