检验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