Open tab with button click using Chrome Tabs API

时间:2016-02-12 21:24:29

标签: javascript google-chrome-extension

Does anyone have any advice on how I would open a new tab in google chrome, using the Chrome Tabs API. I've been trying to do this in my Google Chrome extension, like so

minimum

but this doesn't seem to do the trick. Can anyone see what I'm doing wrong? (ignore the #input from id part, I know that won't work).

Thanks in advance

1 个答案:

答案 0 :(得分:1)

If you don't HAVE to use chrome extension

using System.Collections;

Int32 employeeCount = 5;
var list = new ArrayList(10);

<input type="button" onclick="window.open(document.getElementById('channel').value,'_blank')" /> is the argument needed to open on a new tab.