当前位置: 代码迷 >> Web前端 >> 查验url
  详细解决方案

查验url

热度:280   发布时间:2012-10-08 19:54:56.0
检验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 status
		if(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
  相关解决方案