Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Boodman committed Dec 20, 2010
0 parents commit 04cc2ac
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Binary file added 128.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions background.html
@@ -0,0 +1,27 @@
<script>
chrome.contextMenus.create({
"title": "Open in new tab",
"onclick": function(clickData) { openFrame(clickData, "tab") }
});

chrome.contextMenus.create({
"title": "Open in new window",
"onclick": function(clickData) { openFrame(clickData, "window") }
});

chrome.contextMenus.create({
"title": "Open in incognito window",
"onclick": function(clickData) { openFrame(clickData, "incognito") }
});

function openFrame(clickData, container) {
var url = clickData.frameUrl || clickData.pageUrl;

if (container == "tab")
chrome.tabs.create({url:url});
else if (container == "window")
chrome.windows.create({url:url});
else if (container == "incognito")
chrome.windows.create({url:url, incognito:true});
}
</script>
8 changes: 8 additions & 0 deletions manifest.json
@@ -0,0 +1,8 @@
{
"name": "~pkasting",
"description": "Inverts pkasting by adding a context menu to open frames in a new tab or window.",
"version": "1",
"permissions": ["contextMenus", "tabs"],
"background_page": "background.html",
"icons": { "128": "128.png" }
}

0 comments on commit 04cc2ac

Please sign in to comment.