Skip to content

Instantly share code, notes, and snippets.

@jutememo
Last active December 16, 2015 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jutememo/5513382 to your computer and use it in GitHub Desktop.
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
(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