143
rated 0 times
[
145]
[
2]
/ answers: 1 / hits: 36293
/ 13 Years ago, sat, december 10, 2011, 12:00:00
This is my background.html file, It works fine when opening in current tab but I want it to open in new tab, what am I doing wrong?
<html>
<head>
<script>
// Called when the user clicks on the browser action.
chrome.browserAction.onClicked.addListener(function(tab) {
var action_url = javascript:location.href='http://www.reddit.com/submit?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);
chrome.tabs.create(tab.id, {url: action_url}, function(tab));
});
</script>
</head>
</html>
More From » google-chrome