Rectangle 27 0

How to make Google Chrome extension to run jQuery Script?


$('[id^=changesetList] tr').each(function () {
    var sid = $(this).attr('sid');
    $(this).find('td span.changesetDescription').append('<span class="csetHash">' + sid + '</span>').css('color','#777');
});
chrome://extensions/
{
  "name": "Kiln Hash",
  "version": "1.0.1",
  "description": "Show hash in changeset list in Kiln",
  "content_scripts": [
    {
      "matches": ["https://*.kilnhg.com/*"],
      "js": ["jquery.js", "content_script.js"]
    }
  ]
}
  • Content Scripts (how to include script into a specific domain with jquery)
  • Overview (what's inside extension and what is manifest)

(I can provide you an answer if you like, but it would be more beneficial for you to read those links yourself, it's all described and explained there in great details)

This content script would run on your specified domain after DOM is loaded and jquery is injected.

You don't need a background page for this.

You not only might need a manifest, manifest is an absolutely necessary part of any extension. I hate to say that, but you probably need to read a little more about extension structure first, and all your questions will be answered.

Note