读书人

查验url

发布时间: 2012-10-08 19:54:56 作者: rapoo

检验url

 <script>      // Called when the url of a tab changes.      function checkForValidUrl(tabId, changeInfo, tab) {        // If the letter 'g' is found in the tab's URL...        chrome.tabs.getSelected(null, function(tab) {         // Toggle the pinned statusif(tab.url.indexOf("renren.com")>-1&&!tab.pinned){        //chrome.tabs.update(tab.id, {'pinned': !tab.pinned});}      });      };      // Listen for any changes to the URL of any tab.      chrome.tabs.onUpdated.addListener(checkForValidUrl);    </script>

人人空曾经用过,检验url

读书人网 >Web前端

热点推荐