0

In new tab create method I see that all Parameters for createProperties(object) are marked "optional". But when I try

//if there is no storage create a new tab

var firstRun = (localStorage['firstRun'] == 'true') ;

if (!firstRun)
{
    chrome.tabs.create() 
    {
        console.log("new tab is created")   
    }
}

I get Uncaught Error: Parameter 1 is required.. This answer to a similar question also appears to say that parameters are optional.

What am I missing? Thanks.

Community
  • 1
  • 1
Zeynel
  • 12,517
  • 28
  • 94
  • 143

1 Answers1

1

Just pass an empty object:

chrome.tabs.create({});

The object is not optional, the values in it are.

Digital Plane
  • 35,904
  • 7
  • 55
  • 59