/**
 * Author: wxwdesign@gmail.com
 * Source: https://github.com/wahaha2012/ads-cleaner-extension
 */
(function () {
    var contextMenuId,
        cleanStartUpMenuId;
    chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
        if(request.showContextMenu){
            if(!contextMenuId){
                contextMenuId = chrome.contextMenus.create({
                    "title" : "Clean Advertisements",
                    "documentUrlPatterns" : [
                        "*://*.iteye.com/*",
                        "*://*.eastmoney.com/*",
                        "*://blog.sina.com.cn/*",
                        "*://*.stock.hexun.com/*",
                        "*://*.chinaz.com/*",
                        "*://*.jisilu.cn/*",
                        "*://*.xueqiu.com/*",
                    ],
                    "onclick" : sendCleanMsg
                });
            }
            //clean startup menu
            if(!cleanStartUpMenuId){
                cleanStartUpMenuId = chrome.contextMenus.create({
                    "title" : "Clean Startup Company",
                    "documentUrlPatterns" : [
                        "*://*.eastmoney.com/*"
                    ],
                    "onclick" : sendCleanStMsg
                });
            }
        }
    });

    function sendCleanMsg(info, tab){
        chrome.tabs.sendMessage(tab.id, {
            cleanAds: true
        });
    }

    function sendCleanStMsg(info, tab){
        chrome.tabs.sendMessage(tab.id, {
            cleanStartup: true
        });
    }
})();
@@ -159,16 +159,41 @@
 UpMenuId
+,%0A        translateMenuId
 ;%0A    ch
@@ -1599,14 +1599,1127 @@
 );%0A    %7D
+%0A%0A    function translatePage(info, tab) %7B%0A        var translators = %7B%0A            'Google': 'https://translate.google.com/translate?sl=auto&tl=zh-CN&js=y&prev=_t&hl=en&ie=UTF-8&edit-text=&act=url&u=',%0A            'Bing': 'https://www.microsofttranslator.com/bv.aspx?to=zh-CHS&a=',%0A        %7D;%0A        chrome.tabs.create(%7B%0A            url: translators%5Binfo.menuItemId%5D + decodeURIComponent(tab.url)%0A        %7D);%0A        // console.log(info.menuItemId, tab.url);%0A    %7D%0A%0A    // translate content%0A    if(!translateMenuId)%7B%0A        translateMenuId = chrome.contextMenus.create(%7B%0A            %22title%22 : %22Translate Page%22,%0A            %22documentUrlPatterns%22 : %5B%0A                %22*://*.sec.gov/*%22%0A            %5D,%0A            %22id%22: %22parentMenu%22%0A        %7D);%0A        chrome.contextMenus.create(%7B%0A            %22title%22: %22Google%22, %0A            %22parentId%22: %22parentMenu%22, %0A            %22id%22: %22Google%22,%0A            %22onclick%22: translatePage%0A        %7D);%0A        chrome.contextMenus.create(%7B%0A            %22title%22: %22Bing%22, %0A            %22parentId%22: %22parentMenu%22, %0A            %22id%22: %22Bing%22,%0A            %22onclick%22: translatePage%0A        %7D);%0A    %7D
 %0A%7D)();

add page translate