Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Levy committed Sep 3, 2012
1 parent 3eb629f commit 2e62b97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions chrome/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ function addStoryTitlesToFBAppURLs() {
}

function checkForOpenGraphOAuth() {
var isLooping = localStorage.getItem("lastFBPageAccessed") == document.URL;
var lastFBPageAccessedString = "lastFBPageAccessed";

var isLooping = localStorage.getItem(lastFBPageAccessedString) == document.URL;
localStorage.setItem(lastFBPageAccessedString, document.URL);

if(document.URL.indexOf("dialog/oauth") !== -1 || document.URL.indexOf("connect/uiserver") !== -1) {
var redirectURI = getURLParameterByName( document.URL, "redirect_uri");
Expand All @@ -89,8 +92,6 @@ function checkForOpenGraphOAuth() {
else if(redirectTitle) window.location = "https://www.google.com/search?btnI&q=" + unescape(redirectTitle);
}
}

localStorage.setItem("lastFBPageAccessed", document.URL);
}


Expand Down
7 changes: 4 additions & 3 deletions firefox/data/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ function addStoryTitlesToFBAppURLs() {
}

function checkForOpenGraphOAuth() {
var isLooping = localStorage.getItem("lastFBPageAccessed") == document.URL;
var lastFBPageAccessedString = "lastFBPageAccessed";

var isLooping = localStorage.getItem(lastFBPageAccessedString) == document.URL;
localStorage.setItem(lastFBPageAccessedString, document.URL);

if(document.URL.indexOf("dialog/oauth") !== -1 || document.URL.indexOf("connect/uiserver") !== -1) {
var redirectURI = getURLParameterByName( document.URL, "redirect_uri");
Expand All @@ -89,8 +92,6 @@ function checkForOpenGraphOAuth() {
else if(redirectTitle) window.location = "https://www.google.com/search?btnI&q=" + unescape(redirectTitle);
}
}

localStorage.setItem("lastFBPageAccessed", document.URL);
}


Expand Down
2 changes: 1 addition & 1 deletion firefox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"contributors": "Joe Levy",
"license": "MPL 1.1/GPL 2.0/LGPL 2.1",
"id": "[email protected]",
"version": "1.7"
"version": "1.8"
}

0 comments on commit 2e62b97

Please sign in to comment.