Answer the question
In order to leave comments, you need to log in
How to interact with the DOM tree through a chrome extension?
Good afternoon. I am writing my first extension for chrome, I need it for work:
The extension has: a text field and a button, when you click on the button, a search should occur for what the user wrote in the text field on the page (similar to ctrl + f). But, I am writing this so that the search is needed on the large menu aka the accardion menu, which is hidden (collapsed) by default, so until you expand it, the search is not possible.
The task of the plugin is to expand this tree and find in it what is written in the text field.
Created files:
index.html - plugin body
jquery.js - jquery library is connected lol
manifest.json - manifest file itself
popup.js - jq script itself that should change DOM
The site itself is not available to me, all operations are on the client side, that's why I write the plugin
In manifest.json I have this:
{
"manifest_version": 2,
"name": "ИМЯ ПЛАГИНА",
"description": "Можно модули поискать. Удобно.Наверное...",
"version": "1.0",
"browser_action": {
"run_at": "document_start",
"css": ["css.css"],
"matches": ["урл.сайта"],
"default_icon": "icon.png",
"default_popup": "index.html",
"js": ["jquery.js", "popup.js"]
}
}
.ng-hide {
display:none !important
}
$('ng-hide').css({'display:block !important'});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question