KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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>
Tags (comma-separated)
Save Edits
Cancel