marcusvb
marcusvb

Reputation: 51

How to fix Chrome New Tab function with extention

I'm creating a small extention which when an on-button-click, will open a URL in a new tab.

This is a snippet of part of a function:

var urlLink = "www.google.com";
chrome.tabs.create({ url: urlLink });

However, when the newtab is opened it doesn't go to google.com it puts

chrome-extension://**extentionID**/www.google.com

How do I get it only to go to www.google.com rather than call chrome-extention with the extentionID?

Also I've delcared the following in my manifest.json

"permissions":[
    "tabs"
],

Thanks.

Upvotes: 0

Views: 61

Answers (1)

marcusvb
marcusvb

Reputation: 51

Adding http:// or https:// to the URL fixes this.

Upvotes: 1

Related Questions