Archive for the 'Tips & Tricks' Category
The most recent Google Chrome dev build added a feature that lets you synchronize your bookmarks with a Google account. Because of a technical issue with Google’s new sync technology and because Google Chrome uses folders instead of labels, bookmarks will not be displayed in Google Bookmarks, but in Google Docs.


How to try the new feature? Make sure you use Google Chrome’s dev channel, which includes a buggier and less polished version of Google Chrome. Then create a desktop shortcut for the browser, right-click on the shortcut, select “Properties” and edit the “Target” field by appending:
–enable-sync
(make sure to add a space before pasting the flag). You should see something like this if you’re using Windows Vista:
C:\Users\Ionut\AppData\Local\Google\Chrome\Application\chrome.exe –enable-sync
Restart the browser and you should find a new option in the Tools menu: “Sync my bookmarks”. Enter your credentials and the sync process should start immediately. You’ll be able to access your bookmarks in a weird location: a read-only folder in Google Docs (things will look less weird when Google Docs is transformed into Google Drive, a general-purpose online storage service). Install Google Chrome’s dev build on a different computer and you’ll be able to access your bookmarks, edit them and all the changes will be saved online.
Google will release a sync API so that developers can add similar features for other services. “To make this sync infrastructure scale to millions of users, we decided to leverage existing XMPP-based Google Talk servers to give us “push” semantics, rather than only depending on periodically polling for updates. This means when a change occurs on one Google Chrome client, a part of the infrastructure effectively sends a tiny XMPP message, like a chat message, to other actively connected clients telling them to sync,” explains a Chromium document.
Tip: import the bookmarks from Google Bookmarks by clicking on the Tools menu, selecting “Import bookmarks and settings” and choosing “Google Toolbar” from the list.
Update: The file that implements the syncing algorithms (syncapi.dll) includes many references to GDrive, so it’s likely that Google will use the same technology to synchronize all the files stored in Google Drive.

If you want to write your own plugin for google chrome, this is the place to begin.
My first Google Chrome plugin
I have decided to spend a fair amount of time today on the Google Chrome code. My objective was to understand the functioning of the plugin framework. I have not been able to find any useful information on the web except the Plugin Architecture design document. This article will describe what I have learned and explain how to build a basic plugin that can be tested using the Google Chrome that you have downloaded from the Google website (so no custom modifications required.)
I have found several posts on the web that stated that the Chrome team was working on building the infrastructure that will enable the addition of plugins and extensions. For those who do not yet understand the difference between these two concepts, I will quote Nathan Marz:
Quote:
A software extension in an entity that adds significant unintended functionality to the software.
A software plugin is an entity that adds intended functionality to a plugin in a controlled manner.
But as he rightly adds, “[s]ometimes there is a gray area between these two distinctions.” Right now, I don’t know enough about Google Chrome to dispute that the difference is merely conceptual. I hope that someone can clarify.
The first thing that I learned is that the current release of Google does not offer the ability to load additional plugins. It seems that Google is planning to offer the ability to add plugins via the registration of these plugins under HKEY_CURRENT_USER\\Software\\Google\\Chrome\\Plugi ns. When Google Chrome starts, it will look at the key Path which seems to be the path of the DLL. There is an additional key (LoadOnStartup) which indicates if the plugin should be loaded during startup (as you might have guessed )
So since this logic is disabled in the current release, how are we going to enable the loading of the plugin that we will build? Well, we will name it gears.dll and replace the existing gears.dll. It is not nice as we might want to use gears.dll as well. Unfortunately, unless the Google Chrome team unable the startup load, we will have to do so. Indeed, it seems that the loading of gears.dll is hardcoded.
Ok, let’s build this plugin. As you know, a plugin is not more than a DLL with several functions that have been exported. In the case of Google Chrome, just one function needs to be exported but let’s do some boring stuff before starting coding. First, you have to follow the instructions available on dev.chromium.org that indicates how to build Google Chrome. The reason you need to do that is that you will use several of the static libraries that this build will produce when you compile your plugin (base.lib, icuuc.lib and googleurl.lib.)
There is a very important file that describes the Chrome Plugin API. It can be found at “chrome/common/chrome_plugin_api.h”. Basically what happen, is that you “implement” this API. There are two sets of functions that needs to be implemented. One set relates to the functions that are offered by the plugin to the browser (the host) – the CPP functions, CPP for Chrome Plug-in: Plug-in Defined, but I am not sure – and the other set relates to the function that are offered by the browser to the plugin – the CPB functions, CPB for Chrome Plug-in: Browser Defined. In other terms the browser tells you: “this is a set of services that I want you to provide me with, I will interact with you via a call to a table of functions which have the following signatures. If you believe that I will need to use a particular service when the plugin is being used, please implement it.” Technically, this table is a structure with members that are functions pointer. There is another set of functions which can be implemented by the plugin and/or the browser – the CPR and CPRR functions.
The only function that you need to export is
PHP Code:
CPError STDCALL CP_Initialize(CPID id, const CPBrowserFuncs* bfuncs, CPPluginFuncs* pfuncs)
This function is called by the host when the plugin is being loaded. As you can notice, the browser provides us with the two tables of function pointers. Once we do the mapping, then if the browser needs to interact with the plugin it will used these shared tables.
Our code will make use of two files: test.cpp and test.h (I used Visual Studio 2008.) I have borrowed close to 90% of the code from a chrome plugin file that is part of the source that you downloaded: “chrome/test/chrome_plugin/test_chrome_plugin.h” and “chrome/test/chrome_plugin/test_chrome_plugin.cc”.
Let’s code the CP_Initialize function:
PHP Code:
test.cpp:
CPError STDCALL CP_Initialize(CPID id, const CPBrowserFuncs* bfuncs,
CPPluginFuncs* pfuncs) {
if (bfuncs == NULL || pfuncs == NULL)
return CPERR_FAILURE;if (CP_GET_MAJOR_VERSION(bfuncs->version) > CP_MAJOR_VERSION)
return CPERR_INVALID_VERSION;if (bfuncs->size < sizeof(CPBrowserFuncs) || pfuncs->size < sizeof(CPPluginFuncs)) return CPERR_INVALID_VERSION; CPERR_FAILURE and CPERR_INVALID_VERSION are defined in “chrome/common/chrome_plugin_api.h”. They respectively indicate a generic failure and an incompatibility of API version used by the browser and the plugin. I don’t think that I need to explain these verifications as they are pretty obvious, let’s continue: PHP Code: pfuncs->version = CP_VERSION;
pfuncs->shutdown = CPP_Shutdown;
pfuncs->should_intercept_request = CPP_ShouldInterceptRequest;static CPRequestFuncs request_funcs;
request_funcs.start_request = CPR_StartRequest;
request_funcs.end_request = CPR_EndRequest;
request_funcs.set_extra_request_headers = CPR_SetExtraRequestHeaders;
request_funcs.set_request_load_flags = CPR_SetRequestLoadFlags;
request_funcs.append_data_to_upload = CPR_AppendDataToUpload;
request_funcs.get_response_info = CPR_GetResponseInfo;
request_funcs.read = CPR_Read;
request_funcs.append_file_to_upload = CPR_AppendFileToUpload;
pfuncs->request_funcs = &request_funcs;static CPResponseFuncs response_funcs;
response_funcs.received_redirect = CPRR_ReceivedRedirect;
response_funcs.start_completed = CPRR_StartCompleted;
response_funcs.read_completed = CPRR_ReadCompleted;
pfuncs->response_funcs = &response_funcs;g_cpid = id;
g_cpbrowser_funcs = *bfuncs;
g_cprequest_funcs = *bfuncs->request_funcs;
g_cpresponse_funcs = *bfuncs->response_funcs;
g_cpbrowser_funcs = *bfuncs;
We started the mapping of the functions. As you can see, we will only implement two functions among the CPP functions (made available to the host): CPP_Shutdown (called when the browser is unloading the plugin) and CPP_ShouldInterceptRequest (indicates if the plugin is interested in handling a request.) We want to be able to issue some requests via the browser therefore we implement several CPR functions. We will also process several intercepted requests so we implement some CPRR functions. Finally, we store a reference to these structures as we will use them later.
PHP Code:
test.cpp:
const char* protocols[] = {kChromeTestPluginProtocol};
g_cpbrowser_funcs.enable_request_intercept(g_cpid, protocols, 1);
return CPERR_SUCCESS;
We end this function by informing the browser that the plugin wants to intercept a list of protocols. Let’s define these protocols in the header file.
PHP Code:
test.h
const char kChromeTestPluginProtocol[] = “cptest”;
So let’s suppose that a user enters “cptest:sync” in the location bar. The browser knows that the plugin has requested to be able to process these requests. The browser will use our set of CPRR functions. We have implemented three of these functions: CPRR_ReceivedRedirect, CPRR_StartCompleted and CPRR_ReadCompleted. If you read carefully the description of these functions, you will find that it is CPRR_ReceivedRedirect which is then called. Then we read the data: call to CPR_Read which is followed by a call to CPRR_ReadCompleted. We can start issuing our request. I will stop here but I encourage you to use your debugger to understand the sequence of events.
As you can see in the code, the following requests are implemented: cptest:sync, cptest:async and cptest:blank. Once you install the plugin, you should try them. You will find the source code here.
Finally, if you want to see your plugin listed when you type about : plugins in your location bar, do not forget to add a VERSIONINFO Resource.
If you have any question related to this article, you can always reply to this post. Otherwise, use the other forums.
source : http://www.paperfrag.com/showthread.php?p=1
The browser wars are heating up again. Microsoft’s touting the improved performance and security of Internet Explorer 8, dozens of new Firefox extensions are released every day, and, according to Apple, Safari 4 will be even faster than its speedy predecessor. Meanwhile, Opera just keeps chugging along at version 9.64, with version 10 beta 3 now available.
Just a few weeks ago, Google announced its plans to create an operating system based on Chrome. Considering that the browser itself is barely a year old, such plans may be premature. Then again, maybe not. But for right now, I’ll keep looking for ways to make the Chrome browser more useful.
Last June, I described ways to change Chrome’s default settings. Here’s a look at ways to revamp the browser’s interface and access some of its useful hidden features.
Themes perk up Chrome’s drab interface
Google is famous for its no-frills look, which describes the default Chrome interface as well. You can spiff the browser up a bit by adding one of the 30-or-so themes available for the version 3 beta.
To add a theme, click the options button in the top-right corner (the wrench icon) and choose Options. Under the Personal Stuff tab, click Get themes, or just browse to the Themes Gallery.
If you get tired of a theme, either select a new one or reopen the Personal Stuff tab in the Options dialog and choose Reset to default theme.
Make the most of Chrome’s context-menu options
At first glance, Chrome lacks some of Firefox’s most useful options. For example, Firefox lets you view your recently visited pages by clicking the down arrow next to the Back and Forward buttons. You can get the same information in Chrome by right-clicking either button to see a list of the sites you’ve been to most recently.
Another handy right-click option is to copy a URL and then right-click in the address bar and choose Paste and go. You can also open a link in a new incognito window by right-clicking it and selecting Open link in a new incognito window. And like Firefox’s Undo Closed Tab right-click option, if you inadvertently close a tab, just right-click another tab and choose Reopen closed tab. (You can do the same by pressing Ctrl-Shift-T.)
Useful Chrome keyboard shortcuts
I’m a big fan of keyboard shortcuts, and Chrome’s got several handy ones (note that some of these shortcuts also work in Firefox and other browsers):
• Shift-Escape opens Chrome’s Task Manager, where you can view the amount of memory and CPU cycles used by each open tab.
• Ctrl-Shift-N opens a new incognito window.
• Ctrl-B toggles the bookmarks bar off and on.
• Ctrl-Shift-B opens the Bookmark Manager.
• Shift-Alt-T moves the focus to the toolbar. Switch buttons by using the left and right arrow keys.
• Alt-Home opens your home page.
• Alt-F4 closes the current window.
Some people want to disable JavaScript for security reason. Unfortunately, There is no way to disable/enable JavaScript in Google Chrome as you can do with other browsers by changing a simple setting in its Options dialog. We must add -disable-javascript parameter to Google Chrome shortcut by manual. In this tutorial we will see how to turn JavaScript on/off with following 4 steps:
1. Right click the Google Chrome icon in your desktop, then click Properties.
2. Click Shortcut tab.
3. Add -disable-javascript parameter in the Target field.
4. Click the OK button.

Screenshot image: Disable JavaScript in Google Chrome
In order to enable JavaScript for Google Chrome again, just remove -disable-javascript parameter in the Target field.
When you download a file from a website in Google Chrome, a downloads bar appears at the bottom of the tab where you can monitor the progress of your downloading file. If you’re downloading an executable file (such as files with .exe, .dll, or .bat extensions), first accept the download by clicking Save on the downloads bar. This step helps prevent malicious software from automatically downloading to your computer.
To view your downloads history, click Tools menu, then select Downloads, open the Download page (you can also press the hotkey Ctrl + J or type chrome://downloads/ in the address bar), as it is shown in the screenshot:

Screenshot: Google Chrome download Manager page
- Pause a download
- Cancel a download
- Clear download history
Open the Download page, click the Pause link for the download.
Open the Download page, select the downloaded file, then click Cancel.
Open the Download page, click the Clear all link.
Change the default download location for Google Chrome
By default, Google Chrome sets your download location to /Documents and Settings/<user>/My Documents/Downloads. To set a specific location, please follow these steps:
- Click Tools menu, then select Options.
- Click the Minor Tweaks tab (or Under the Hood if you’re using Google Chrome Beta).
- Click the Browse button in the Downloads section and choose a download location.
- If you’d rather choose a specific location for each download, please check the Ask where to save each file before downloading option.
- Click the Close button.
Automatically open downloaded files
If you want files that have the same file type as the one you’re downloading to always open after they’re done downloading, click the menu arrow next to the file button in the downloads bar, then select Always open files of this type, as it is shown in the screenshot below:

Screenshot: Automatically open downloaded files in Google Chrome
To prevent potentially malicious files from automatically downloading to your computer, this option isn’t available for executable file types, such as those with .exe, .dll, or .bat extensions.,
Very kind source: http://www.chromefans.org/chrome-tutorial/how-to-manage-my-downloads-in-google-chrome.htm
Two days ago I was visiting Google Chrome’s official blog that contains articles which are written by Google’s workers (developers, software engineers etc). I found out a new tip about opening links in new tabs. Really useful tip and important for new users who are trying to get accustomed to Chrome. This is where I share this tip:
Tabs can be great for working with multiple pages at the same time. But if you open them by right-clicking links and selecting “Open link in new tab,” you might not have realized that there’s an easier way. Just use your middle mouse button (it might look like a wheel) to click a link, and it will open in a new tab in the background.

“But wait,” you say, “my mouse doesn’t have a middle button!” No problem — another way to get the same effect is to hold down the Ctrl key while clicking (with the left mouse button) on a link.

(If clicking the middle button on a link doesn’t open it, your mouse may be set to use the middle button for something else. You can configure your mouse settings by going to the Windows Control Panel.)
Source: http://chrome.blogspot.com/2009/08/tip-opening-links-in-new-tabs.html
- Shut down any unnecessary services
- Reboot your computer
- Using the windows task manager, measure the Total Commit Charge of the system*
- Run the application you are seeking to test, in this case, Chromium
- Measure the Total Commit Charge again
- Close the application
- Measure the Total Commit Charge one more time
- Subtract your first measurement from your second, and you should have the memory used by Chromium
- To validate your test, make sure that the first and last measurement are nearly identical
Google Chrome contains many new features that can be harnessed by developers and webmaster to deliver a better end-user experience. The JavaScript virtual machine used by Google Chrome also, the V8 JavaScript engine, has features such as dynamic code generation, hidden class transitions and precise garbage collection. This means that you can create more complex and more intensive AJAX applications with fewer speed and processing constraints with V8 engine.
Test your website in Google Chrome
If you are a web developer or webmaster, there are several useful tools to help you test your website in Google Chrome:
- JavaScript Debugger
- JavaScript console
- Web Inspector
- Task Manager
- Other shortcuts
- about:
- about:dns
- about:plugins
- about:memory
- view-cache:[URL]
- view-source:[URL]
Click the Page icon, and then select Developer > Debug JavaScript to open the JavaScript Debugger window. You can also press the hotkey Ctrl+Shift+L. Type help for a list of commands. There is an article Sample debug session with Google Chrome JavaScript debuger from alexatnet.com.

JavaScript console is a component of Google Chrome web inspector that analyzes the JavaScript code and any script errors associated with a specific webpage element. To launch JavaScript console window, click Page icon, and then select Developer > JavaScript console (or press Ctrl+Shift+J).
Right-click on any component on a web page and then select Inspect element to launch the web inspector. You’ll be able to see the elements and resources associated with the component on which you clicked, including a hierarchy view of the DOM and a JavaScript console.

Use the Task Manager to get details (memory, CPU, and network) about all running Google Chrome processes, or to force a misbehaving tab or application to close. To open the task manager, click the Page menu icon, then select Developer > Task Manager (or press Shift+Esc).

Type any of the following shortcuts in the address bar to see more information:
Source: http://www.chromefans.org/chrome-tutorial/how-to-test-my-web-site-in-google-chrome.htm
We recently showcased how the address bar (also affectionately known as the Omnibox) doubles as a search box: simply type a search term in the box and press Enter to see results from your default search engine.
Here’s another fun fact about the address bar: you can use it to search sites that you’ve previously visited.
Say you frequently go to YouTube to watch funny videos. The next time you need a good laugh, just start typing “youtube” in the address bar. After a few letters, the address bar will automatically offer you the option to search the site.
Now the cool trick: hit Tab on your keyboard to convert the address bar into a search box for the site.
Then type what you’re looking for and press Enter. Google Chrome will immediately bring you to the search results page on that site. In this case, you’ll see YouTube’s search results page for “dog on skates”:
Use this “tab to search” shortcut to save yourself a few clicks the next time you want to quickly search a site. Try it out and let us know what you think!
Source: http://chrome.blogspot.com









