Nitish Shangari
Nitish Shangari

Reputation: 55

How to use a jQuery tooltip in a Google Chrome Extension's content script?

I want to have a tooltip for certain elements on all those web pages which are affected by my chrome extension. The jQuery UI provides tooltip functionalities but I am not able to use them into a content script.

  1. What changes would I need to make to the manifest.json file?

  2. How to get the $('tag').tooltip() working?

PS : Initial research from my end says that using jQuery in a normal web-page-JS tie-up is different from using jQuery tooltip in a chrome extension.

Thanks in advance!

Upvotes: 1

Views: 1529

Answers (1)

Sindar
Sindar

Reputation: 10839

For sure you can !

Add this on your manifest :

"content_scripts": 
[ {
      "all_frames": true,
      "css": ["css/xxx.css"],
      "js": ["js/jquery.js", "js/xxx.js"],
      "matches": ["http://*/*", "https://*/*"],
      "run_at": "document_start"
} ], 

Then you can use jQuery like if it was a normal web page using your content-script ;)

Upvotes: 2

Related Questions