Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aaron Boodman
committed
Dec 20, 2010
0 parents
commit 04cc2ac
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" } | ||
} |