Showing posts with label Chrome Extension. Show all posts
Showing posts with label Chrome Extension. Show all posts

Tuesday, January 25, 2011

Make your GreaseMonkey script fully compatible with Chrome using TamperMonkey

Google Chrome announced its support for GreaseMonkey back in Feb 2010 which opened the gates for GM script writers to write thousands of scripts for Chrome. Any script that doesn’t use specific GreaseMonkey API (GM_*) should work fine with Chrome. However, a study conducted by GreasePot reveals that about 40% of scripts in userscripts.org use GreaseMonkey API. In other words, only 60% of the scripts in userscripts.org will work in Chrome. Top APIs being used include GM_getValue, GM_setValue, GM_xmlhttpRequest. Chrome does not support any of the GreaseMonkey API for security reasons. The rest of the post will sketch out two mechanisms to make your script fully compatible with Chrome.

Google Chrome GM_* emulation

  • An userscript to emulate the GreaseMonkey functionalities in Chrome. Supported functions: GM_setValue, GM_getValue, GM_deleteValue, GM_registerMenuCommand, GM_xmlhttpRequest, GM_addStyle.
  • GM_getValue and GM_setValue functions use Chrome’s local storage to store the data.
  • GM_xmlhttpRequest can be used to make only *same domain* AJAX requests. This is a major limitation with this approach.
  • Download and install the script from here.

TamperMonkey

  • A Chrome extension which provides enhanced userscript support on Google Chrome and Chromium browsers. All GM_* functions are supported. This is a cleaner solution than the above script.
  • GM_xmlhttpRequest is supported with cross domain access.
  • A small UI has also been included with the extension from which you can manage the installed scripts.
  • The extension also takes care of checking if there are any new versions of the installed userscript is available. This will be useful to keep your userscripts up-to-date. If you a GM script writer, recommend your users to install this extension before installing your script.
  • Download and install the extension form here.

image

-- Varun

Tuesday, December 28, 2010

Start menu for Google Chrome

Most of you would have been already aware of the fact that Google has launched its Chrome web store recently. If you are using the latest versions of Chrome, you can install apps on your Chrome from the web store. Once the app is installed, you can launch it from the popular “New Tab” page of Chrome. A new section titled “Apps” has been added to the “New Tab” page. This section will show the icons of all the installed apps as Thumbnails. Clicking on the app icon will launch the app. If you have a big list of apps installed on your Chrome, it will become difficult to search for the app and launch it from here. To make it simple, Google has built an extension “App Launcher” which will act as a Windows Start Menu for Chrome.

Apps section of "New Tab" page

App Launcher for Chrome

App Launcher for Chrome is an extension built by Google for launching the apps installed on Chrome. Install the extension from here. The extension will add a browser action icon clicking on the same will show a list of installed apps. From there, you can launch an app by either clicking on it in the list, or using arrow keys to select it and then pressing enter. The search box on top of the list is quite handy. (However, you have to use only lower cases while searching. Looks like a bug). With this extension, you can launch an app from any page without having to open the “New Tab” page.

App Launcher

-- Varun

[via @labnol]

Wednesday, December 22, 2010

Voice Search in Google Chrome

If you are a smart phone user, you would have definitely tried any one of the “Voice Search” applications. Voice Search provides a method  to search by speaking to your device. I use “Voice actions” on my Android quite extensively and it is very useful to me. Now, there is a Chrome extension to get the same functionality on Google Chrome browser as well. The extension is still under development and you can’t expect it to be 100% perfect.

Voice Search Chrome extension Voice Search Options

Voice Search icon on Google search box  

Voice Search Chrome extension

  • Install “Voice Search” extension by pointing your Chrome to this URL.
  • If you are using Chrome 9 or higher, you may need to explicitly enable speech input. To do so, start your Chrome instance by setting the flag “--enable-speech-input”. It will be enabled by default on Windows. If you are on Mac or Linux, you can use this flag to enable speech input.
  • Whenever you visit any of the popular services, you will find a small microphone (like the one shown in the screenshot above) in the search box. Default services: Google, Wikipedia, YouTube, Bing, Yahoo, DuckDuckGo, WolframAlpha. It also works with any website using HTML5 search boxes.
  • Click on the microphone icon and start speaking. The extension will recognize the search terms and will populate the search box. Note: The extension is still under development. So, don’t be surprised if it gives out totally irrelevant text.
  • You can enable voice search on your favorite site by adding the same from the options page.

-- Varun

google-site-verification: googlea4d68ed16ed2eea6.html