Skip to content

Instantly share code, notes, and snippets.

@mohamedmansour
Created June 19, 2011 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mohamedmansour/1034305 to your computer and use it in GitHub Desktop.
Save mohamedmansour/1034305 to your computer and use it in GitHub Desktop.
Disqus Chrome Extension Injection
// 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!';
}
}
{
"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