Skip to content

Instantly share code, notes, and snippets.

@osamu2001
Created March 26, 2010 01:56
Show Gist options
  • Save osamu2001/344385 to your computer and use it in GitHub Desktop.
Save osamu2001/344385 to your computer and use it in GitHub Desktop.
//Copyright bill.mill(tabcopy),ryuusei(Copy Title+URL to clipboard)
<script>
function copyToClipboard(str) {
var obj=document.getElementById("hbnaclhngkhpmpgmfakaghgjbblokeeh");
if( obj ){
obj.value = str;
obj.select();
document.execCommand("copy", false, null);
}
}
function copyallwindows() {
win = chrome.windows.getCurrent(function(win) {
chrome.tabs.getAllInWindow(win.id, function(tabs) {
var s = "";
for (var i=0; i < tabs.length; i++) {
s += tabs[i].title + '\n' + tabs[i].url + '\n';
}
copyToClipboard(s);
window.close();
})
});
//chrome-extension://knjcakomgdkfclbkoapiobdonobblkab/popup.html
}
copyallwindows();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment