chrome extension for setting default search engine - google-chrome

I am developing an extension for chrome, which sets a search engine as default with out any UI interaction(Edit search Engines). Is it possible to develop this kind of extensions. Is there any way such that I can override or use some functions in chrome source code.
Thanks
sathi.

Currently, it is not possible. The closest you can do right now is use the experimental omnibox API to register your own custom keyword.
Feel free to file a feature request at http://crbug.com if you would like to see an API like this in Chrome. Depending on your use case, there could be a better way doing what you wanted. Changing search engines isn't favourable without user intervention..

Related

Is there any way to achieve function such as the picture effect?

Is there any way to achieve function such as the picture effect?
This is a Browser function run in the Smartisan TNT.
It enables the user to enter a search and then open different web pages(etc. Reddit/twitter/Youtube/Stack Overflow) at once for a broader search.
and now, I want to make that functionality in Chrome via a plugin.
BUT, If I use HTML iframes(doesn't support cookies), so I can't keep loggin, and there are many sites that can't be searched without cookies.
In addition, Chrome's plugins have neutered the crawler function, and Google Search have disabled crawlers (they ask you to verify the bot once you crawl), so the way to reconstruct pages through crawlers is not available now.
Smartisan TNT Browser

how to use google search in googleweblight

I'm trying to browse this url: googleweblight.com/?lite_url=http://www.google.com
but I'm not able to, since I got:
Transcoding test failed:
This page could not be transcoded due to technical issues.
The problem is that I need to copy paste every search result I get from google search page into googleweblight.com/?lite_url=[here]
Why am I not able to use googleweblight for google? How can I make my urls go to googleweblight version directly, without copy and paste and not using a device emulator in user agent?
On Firefox, I am using the UAControl add-on to change my browser's User-Agent to Mobile Safari, and it gives me the mobile version of Google Search, which by default has all search result URLs pointing via GoogleWebLight.
In fact, since I didn't want the URLs to be redirected via GoogleWebLight as such, I had to write a GreaseMonkey script to convert them back to 'regular' (direct) URLs. Maybe you can modify it to do the opposite on the Google Search page, if you're not comfortable with the User-Agent switch approach. I believe you can utilize something like TamperMonkey if you're on a different browser such as Google Chrome.

Options page in new Firefox WebExtensions API

Is there a way to write addon options page in new Firefox WebExtensions API?
For example Google Chrome supports manifest key "options_page"
I searched through documentation and wiki but can't find anything on this point.
This answer is out of date as WebExtension support expands.
See Implement a settings page on MDN (and please upvote this answer for providing this link first).
It does not seem like "options_page" manifest key is supported as of now.
Its main use is providing UI discoverability of the options page; a link to it in the extension list, for instance.
If you're porting an existing extension, you'll need to add some other UI in your extension to open the page (e.g. a link in the popup, if the extension has one). You can simply open it with chrome.tabs.create like you would open any page and it will work identically.
A little caveat: if the extension uses OptionsV2-provided CSS styling, you'll need to compensate for its absence.
Another caveat: the chrome.runtime.openOptionsPage() function is not available in Firefox and should be replaced by a shim using chrome.tabs.
Use the options_ui key in your manifest.json. There is nice guide on MDN on how to do this - Implement a settings page.
Both "options_page" and "options_ui" will be implemented in Firefox WebExtensions!
Here is the link for tracking progress http://arewewebextensionsyet.com/#options

Is it possible to hide extension resources in the Chrome web inspector network tab?

When I'm viewing the downloaded resources for a page in the Chrome web inspector, I also see the HTML/JS/CSS requested by certain extensions.
In the example above, indicator.html, indicator.js and indicator.css are actually part of the Readability Chrome extension, not part of my app.
This isn't too big a deal in this particular situation, but on a more complex page and with several extensions installed, it can get quite crowded in there!
I was wondering if there was a way to filter out any extension-related resources from this list (i.e. any requests using the chrome-extension:// protocol).
Does anyone know how I could achieve this?
Not quite the solution I was after (I'd have preferred a global setting), but there is now a way to filter out requests from extensions, as mentioned by a commenter on the issue I originally opened.
In the network tab filter box, enter the string -scheme:chrome-extension (as shown below):
This is case-sensitive, so make sure it's lowercase. Doing this will hide all resources which were requested by extensions.
Just enter "-f" in Network field
Was having the same question when my extension adds a lot of noise in the network tab.
Some extensions also fire a lot of data like data:text/image etc, you can append more filter with - like:
-scheme:chrome-extension -scheme:data
Another way to get the http/https requests is to just use scheme:https without - because the resources that extensions request are usually from their local bundle:
scheme:https
An Incognito Window, can be configured to include or exclude extensions from the extensions page of Chrome settings.
One alternative is to go to "Network Request blocking" tab and add "chrome-extension:" to the list, thus extension requests will be blocked and coloured red so it's easy to visually filter them out.
you can simply enable this option and requests from extension will be group.
Update: It can only group requests that create by the extension that draw iframe, such as cVim

google maps providing directions in local language

I noticed that Google maps is providing directions in my local language (hungarian) when I am using google chrome, but English language directions when I am using it from IE.
I would like to know how chrome figures this out and how can I write code that is always returning directions on the user's language.
HTTPrequests` include an Accept-Language header which is set according to your locale preferences on most OS/browser combinations. Google uses a combination of that, the local domain you use (eg 'google.it', 'google.hu') and any preferences you set with the Preferences link in the home page to assign a language to your pages.
It's likely that IE is misrepresenting your locale to Google Maps, whereas Chrome has correctly guessed it. You can change IE's locale by changing your national settings in Control Panel, while Chrome's locale can be changed in (wrench menu) > Preferences.
I could be way off but I think it's fairly safe to assume that google, is using gears.