0

I've made a quick .js script to mute certain words on Twitter's website - it just hides the tweet if it contains any of the specified words.

I plan to distribute this script, but rather than having to deal with users updating from time to time, I plan to just upload the script to my website then have the addon just embed that script for Twitter's website, adding it to the code.

But how would I make it so the code "injecting" the script is added to the header of Twitter's website?

tl;dr: I want to be able to add code to Twitter's website to call a javascript file. (http://domain.tld/directory/script.js)

Thanks!

Wladimir Palant
  • 56,865
  • 12
  • 98
  • 126
user866260
  • 81
  • 9

2 Answers2

-1

You can't insert your part of js script on twitters website.. if you can then its a security issue from twitters website... all you can do is ... write a browser plugin and run your actions when the browser open's up the twitters page.... but not automatically inject your script when someone open a twitter website in their browser.

Satish Bellapu
  • 740
  • 1
  • 5
  • 15
-1

You could create a Chrome Extension. Extensions can inject script code into websites and have them operate in the websites scope.

http://developer.chrome.com/extensions/content_scripts.html

Robin Drexler
  • 4,307
  • 3
  • 25
  • 28