Skip to content

Instantly share code, notes, and snippets.

@yangg
Created November 15, 2011 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangg/1366415 to your computer and use it in GitHub Desktop.
Save yangg/1366415 to your computer and use it in GitHub Desktop.
Open Frame in New Tab in Chrome
<!DOCTYPE HTML>
<html>
<script>
function createMenu() {
chrome.contextMenus.create({
title: "Open &Frame in New Tab",
onclick: function(info, tab) {
chrome.tabs.create({
url: info.frameUrl || info.pageUrl,
index: tab.index + 1,
selected: true
});
}
});
}
createMenu();
</script>
</html>
{
"name": "framenewtab",
"description": "Open Frame in New Tab in Chrome",
"version": "1.0.0",
"permissions": ["contextMenus", "tabs"],
"background_page": "background.html"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment