Google will shut down Google Code

Well, Google said, there are more great services like Github and Bitbucket, so Google code is not needed any more,  it will shut down Google code service soon. And there is some tools to export your projects to other platform like Github, Bitbucket or SourceForge.

The shut down schedule is:

  • March 12, 2015 – New project creation disabled.
  • August 24, 2015 – The site goes read-only. You can still checkout/view project source, issues, and wikis.
  • January 25, 2016 – The project hosting service is closed. You will be able to download a tarball of project source, issues, and wikis. These tarballs will be available throughout the rest of 2016.

At the same time, Google says it will continue serve some projects like Android and Chrome so that user can continue git them. And also will continue maintaining  mirrors for projects like Eclipse kenel.

Google also gives an export tool to export your project to Github.  And also here is another tool to export any of your projects to Github/Bitbucket/SourceForge.

SourceForge also supplies an import tool to import Google code project.


Firefox Addon: How to use gmail.js in Firefox Addon SDK

Well, gmail.js is a very nice script that if you want to work with Gmail (developing browser extensions for Gmail).

The author says that gmail.js is designed for Chrome extension development. There is also many examples about how to use it in Chrome extension. But, how to use it in Firefox addon development?

If you inject it directly in the page, you will got an error: GLOBAL is not defined.

it is because the gmail.js uses 2 variables in the Gmail page, GLOBAL  and also VIEW_DATA. If you inject it directly by pageMode, it can not access any page script.

So you need to modify the gmail.js, in line 6 and 7 (if line number is different, just search it ). By using unsafeWindow , you can access the Gmail page variable:

api.tracker.globals =GLOBALS;

api.tracker.globals = unsafeWindow.GLOBALS;


api.tracker.view_data = typeof VIEW_DATA !== "undefined" ? VIEW_DATA : [];


api.tracker.view_data = typeof unsafeWindow.VIEW_DATA !== "undefined" ? unsafeWindow.VIEW_DATA : [];

Then you can use the gmail.js without error.

Actually in Chrome extension, you can not inject gmail.js with content script decoration in manifest.json directly, because in that way  you can not access GLOBAL too.

You need to use another content script to inject it  with add <script> block in the page, here  is the code snap

window.onload = function () {

    //inject jQuery
    var jq = document.createElement('script');
    jq.src = chrome.extension.getURL("lib/jquery-2.1.1.min.js");

    //inject gmail.js
    var sm = document.createElement('script');
    sm.src = chrome.extension.getURL("lib/gmail.js");
    //inject the script that actual do your things 
    var ct = document.createElement('script');
    ct.src = chrome.extension.getURL("content.js");

Then declare this file as content script in the manifest.json. and also declare all 3 scripts in web_accessible_resources.

BF4:got return from EA after half a month

About half a month ago, I purchased BF4 from

When I was purchasing, there are 3 editions in the store page, standard edition, deluxe edition and premium edition. My friend told me  that the premium edition does not comes with base game. So I purchased the standard edition first and then purchased the premium edition after several days.

Today when another friend asked me to help him purchase BF4 from origin, I found another item called premium membership, I realized that the premium edition actually contains base game. So I tried to ask for return. After I chat with their advisor, told him I placed a wrong order , they gave me return very fast.

I really like EA’s customer service.


BF4: How to open all batch BattlePacks with 1 line code or bookmarklet

Some time you will get many BattlePacks that you forgot to open them, Well when you want to open them, you are gonna click “open” and “close” again and again?

Just drag and drop this bookmarklet to your bookmarks bar, and go to BattlePacks page, then click it


Here is how to open these BattlePacks with 1 line code in the Browser console.

  1. Go to BattlePacks page
  2. Open console(Ctrl-Shift-J for Chrome, Ctrl-Shift-K for Firefox, Ctrl-Shift-I for Opera, F12 for IE )
  3. Copy and paste this line to your console and then press Enter:
  4. Your BattlePacks should all Open
  5. Copy and paste this line to your console and then press Enter:
  6. all the open BattlePacks dialog should closed:)
  7. Then refresh the page to check the content of all of the packs

That’s All.

终于调通了Google API For JavaScript

说起来惭愧,作为一名Google开发者,这么重要一个API 应该很早以前就会用的。但是因为其他工作一直忙,这个目标就没有实现…




Chrome: How to use extension that not from web store

From  version 35,  Chrome will disable extensions that not come from Chrome web store. It do makes your Chrome safer,  But it also bring some problems for some users.  That is, If you are using a extension that you don’t want to upload it to the Chrome web store, you can not use it anymore. This extension will be disabled and can not be enabled:

Well, here is how to re-enable extensions like this (not from Chrome Web Store):

  1. navigate to chrome://extensions page. delete the disabled extension by clicking the trash icon
  2. find your extension file that ends with .crx or .zip extension.
  3. right click on the file, use 7-zip software(or any other extract tool) with “Extract to…” command to extract the extension
  4. drag and drop the extracted FOLDER to the chrome://extensions page.
  5. Confirm the permissions  confirmation information
  6. You are done.

You can also manage your extensions with my Extension
One Click Extension Manager -No Ads