Last active
December 16, 2015 23:19
-
-
Save jutememo/5513382 to your computer and use it in GitHub Desktop.
Firefox で「混在コンテンツ」をブロックする仕様変更に対する対策。http ではなく、https に接続するように変更した。 cf. https://support.mozilla.org/ja/kb/how-does-content-isnt-secure-affect-my-safety
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var fbPage = function(){ | |
var that = {}, | |
_paths = location.pathname.split('/'); | |
var hasUserName = function(){ return _paths.length == 2; }; | |
var feed = function(id){ | |
var req = new XMLHttpRequest(); | |
req.onload = function () { | |
location.href = "https://www.facebook.com/feeds/page.php?format=rss20&id=" + id; | |
}; | |
req.open("GET", "https://graph.facebook.com/" + id); | |
req.send(); | |
}; | |
var getFeed = function(){ | |
if (hasUserName()){ | |
var req = new XMLHttpRequest(); | |
req.onload = function () { | |
feed(JSON.parse(this.responseText).id); | |
}; | |
req.open("GET", "https://graph.facebook.com" + location.pathname); | |
req.send(); | |
} else { | |
feed(_paths[3]); | |
} | |
}; | |
that.getFeed = getFeed; | |
return that; | |
}; | |
var fb = fbPage().getFeed(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment