Skip to content

Instantly share code, notes, and snippets.

@Gateswong
Created December 28, 2012 08:11
Show Gist options
  • Save Gateswong/4395784 to your computer and use it in GitHub Desktop.
Save Gateswong/4395784 to your computer and use it in GitHub Desktop.
Open link in a new popup window in Chrome.
{
"name": "Poput it up!",
"version": "1.0",
"description": "Open the link in a new popup window instead of new tab",
"permissions": ["contextMenus", "tabs"],
"background": {
"scripts": ["menu.js"]
},
"manifest_version": 2
}
function openNewWindow(info, tab) {
window.open(info.linkUrl, '', 'toolbar=no,status=no,menubar=no,location=no,resizable,scrollbars,directories=no,width=680,height=530,left=100,top=100');
}
var link = chrome.contextMenus.create(
{ "title": "弹出窗口中打开",
"contexts": ["link"],
"onclick": openNewWindow
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment