Google Chrome access search engine settings from extension - google-chrome

I need access to search engines settings from Chrome extension to populate context menu with search engines list.
Extension operate as follows:
User select text, opens context menu with submenu "Search {selection} by ..." and get list of engines, click needed engine and go to relevant search url

Your best option is going to manually build an extensive list of search engines that are displayed to the user. There is no pragmatic method of collecting currently installed search engines.

Related

How to remove istartsurf from browser

How to remove istartsurf from chrome?
Context: I've installed a bunch of extensions after a day I got "istartsurf" as my main search engine in chrome which sends the search to their server and then redirects the search to google making it seem like you searched on google from the start. It takes a split second then you only see google.com in the address bar.
I've installed
chrome extensions: Requestly, Toby for Chrome
apps: Java, JDK, postgresql.
Can anyone relate to this? as I want to narrow done the source of this.
For Chrome you need to go to settings > Search engine
For Search engine used in the address bar set Google (or whatever you want)
For Manage search engines go through to the lists and remove anything suspicious.
Similar should be done for other browsers.
If this goes deeper (registry or something else) please let me know so I can update the answer.

Disable the "Search Google for" in Chrome context menu

After a fair amount of searching I have been unable to find a solid answer on how to disable, or remove, the "Search Google for..." option in the Chrome context menu. I am unable to find any options related to it within the browser itself or within the preferences file in the AppData/local/Google/Chrome/UserData/Default directory. Is this even possible or is there a manifest/config file I am completely missing? Currently on Chrome Version 79.03945.117 - Feedback or guidance would be greatly appreciated.
I don't know how to remove the menu item, but I found if you change your search provider to X, the menu option changes to "Search X for...".
I was also able to create a fake search provider in Chrome Settings and set it as the default for both searches from the location bar, and searches from the context menu. I searched settings for "search", clicked "Add" next to Other search engines, and entered "localhost" as the name and keyword and http://127.0.0.1/search/%s for the Query URL. I then clicked "make default" on this search engine. Note: if you do this all searches will fail since there's not a real search engine at localhost; the point of doing it for me is to prevent any accidental searching when I have highlighted text that contains, say, a password, that I don't want to send to the Internet.

Change browser search engine for every user/machine in windows domain

I want every workstation in my school to have Ecosia as their default search engine.
If one wants to change his search engine to Ecosia on his home computer with Firefox he needs to add the extension to his Firefox profile and change his default search engine to the then added option "Ecosia"
But it is hard to do this for every user in our Windows domain automatically.
My easiest option would be to deploy a script to modify the Firefox(Chrome/Edge) installation but didn't find a way to change the configured search engine. Adding the extension seems to be no problem.
Also I can not change anything in the user files as they are not saved locally but on the domain controller. (Otherwise I could just overwrite the users Firefox profiles)
Some of the other options to deploy custom Firefox installers in companies included preinstalled extensions but I haven't found a configuration that included the search engine configuration.
I want to change the search preferences in Firefox, Chrome and Edge. Firefox alone is driving me crazy.
But there must be a way to achieve this as many viruses doing search hijacking change your search engine without problems event though i was not able to find any source code of those.
So in the end the question is:
Is there a way to add an extension and change the search engine of Firefox/Chrome/Edge without touching the user data or is there a way to preconfigure installers to include a different standard search engine?
I'm kinda desperate by now, so any approach is welcome.
To be specific:
My school has about 200 computers with Windows7/Windows10
combined in a windows domain. Each Student has his own account.
The system for distributing software installers/scripts is opsi
If you use Firefox ESR, you can set up search engines via GPO.
You can add a search engine as part of your web extension via chrome_settings_overrides.search_engine in the extension's manifest (example); making it the default will prompt the user.
The way "viruses [are] doing search hijacking change" is probably by storing the search plugin file to searchplugins and updating the user preferences file.

Add suggestion URL for custom search engine in chrome

I have a local search engine backed by a elasticsearch and a thin nodejs API for search. I want to be able to search those documents from Google Chrome (builds available from Google, not Chromium) directly. In this use case, I will use chrome ONLY with this search engine, so I don't want to use OmniBox keyword search API. I want the same behavior as I get while choosing the default search engine in chrome. Which is
Start typing in the OmniBox and it shows a list of suggestions.
Hit enter and it takes to the search results page
I got the #2 working by adding a new search engine under settings and providing the search api's url. I can't get #1 working.
The two urls exposed by my server are:
http://localhost:3000/complete?query=my (this returns a list of search suggestions which I want to show while typing in OmniBox).
http://localhost:3000/results?query=my+sample+query (this returns the actual search results as a web page, this is working)
Things that I have tried:
Added search engine using window.externals.AddSearchProvider with OpenSearchDescription.xml link. The XML has suggestions url as well.
Tried writing a background extension with OmniBox but it does not allow me to search without using a keyword
I searched through Chromium and found this JSON file
https://code.google.com/p/chromium/codesearch#chromium/src/components/search_engines/prepopulated_engines.json&q=prepopulated&sq=package:chromium&l=1
But I don't know how can I use it (or if its even possible to do this in official builds of Chrome).
I finally found the solution.
The opensearch.xml document reference can be used as a link in the head section of the HTML page. It contains two URL schemes, one for search results and other for suggestions.
The details can be found here:
Opensearch Document Specs.
As soon as I updated my index.html and opened the page in Chrome, Chrome automatically added a new search engine. It didn't show that there is a suggestions URL under Settings > Manage search engines.
Next, I chose my engine as the default search engine by clicking on Make Default and done! Now I can see all the search suggestions in the omnibox without using a keyword.
There is a Setting Overrides mechanism for Chrome Extensions, which is not widely known, which can achieve what you want, but:
At least according to the docs, it only works on Windows and Mac.
You won't be able to publish the extension unless you can verify the site in Webmaster Tools. Otherwise, you are stuck with unpacked installs.

Chrome extension History API

I am writing a chrome extension that needs to analyze the recent browsing history for a particular tab. The chrome.history API allows me to search for items in the global history, but seemingly provides no means to localize the results to a particular tab. Am I missing something, or is this impossible to get?
I think what you are looking is the navigation API. The Chrome history is not related to a particular tab. If you want to use or delete from the history a element of the tab navigation you can use the history search function with the navigation information.