Friday, 26 July 2019

How to access to container search Firefox add-on

How can I access the container that appears when I write a url in the address bar? I have a search engine, I just need to show an icon plus a url in the panelenter image description here

researching I could only get a basic javascript

function createMenuItem(engines) {
  for (let engine of engines) {
    browser.menus.create({
     id: engine.name,
     title: engine.name,
     contexts: ["selection"]
   });
 }
}
browser.search.get().then(createMenuItem);
browser.menus.onClicked.addListener((info, tab) => {
  browser.search.search({
    query: info.selectionText,
    engine: info.menuItemId
  });
});


//php get variable code
if(isset($_GET["term"])) {
        $term = $_GET["term"]; 
    } else {
        header('location: '.$url.'');
    }
//json
"search_url": "https://127.0.0.1/search/search?term={term}"

result

enter image description here

I tried it with

${term}
$term
{term}
term



from How to access to container search Firefox add-on

No comments:

Post a Comment