Created
June 19, 2011 13:53
-
-
Save mohamedmansour/1034305 to your computer and use it in GitHub Desktop.
Disqus Chrome Extension Injection
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
// We just need to check if the IFrame origin is from discus.com | |
if (location.hostname.indexOf('.disqus.com') != -1) { | |
// Extract the textarea (there must be exactly one) | |
var commentBox = document.querySelector('#comment'); | |
if (commentBox) { | |
// Inject some text! | |
commentBox.innerText = 'Google Chrome Injected!'; | |
} | |
} |
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
{ | |
"name": "Disqus Inject", | |
"version": "0.1", | |
"description": "Disqus Inject", | |
"content_scripts": [ | |
{ | |
"matches": ["http://*/*"], | |
"js": ["cs.js"], | |
"run_at": "document_end", | |
"all_frames": true | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment