Created
November 26, 2013 17:21
-
-
Save joahg/7662305 to your computer and use it in GitHub Desktop.
The magic behind JoahG/cc-forumfix_chrome-extension
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(){ | |
if (typeof CCDATA.forum != "undefined" && window.location.pathname.split("/")[window.location.pathname.split("/").length - 2] === "forum_questions") { | |
id = window.location.pathname.split("/")[window.location.pathname.split("/").length - 1]; | |
$.ajax({ | |
url: "http://www.codecademy.com/forum_questions/" + id, | |
dataType: "json", | |
type: "GET", | |
beforeSend: function (e) { | |
e.setRequestHeader("X-Requested-With", "XMLHttpRequest"); | |
e.setRequestHeader("Accept", "application/json, text/javascript, */*; q=0.0") | |
}, | |
success: function (e) { | |
console.log(e) | |
} | |
}) | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment