Redirect window.location.href和Chrome扩展名-新建选项卡

Redirect window.location.href和Chrome扩展名-新建选项卡,redirect,Redirect,我有一个输入框,在那里我可以输入一些东西 <input type="text" id="query"> 并用 window.location.href = "http://site.com/" + query; 当我单击按钮onclick=“func();”时会发生这种情况 当我有一个常规的.html文件时,它可以工作,但当我把它放入我的Chrome扩展名时,它不会重定向。它甚至什么都没做 我试着把 chrome.tabs.create( { url: "http://www.s

我有一个输入框,在那里我可以输入一些东西

<input type="text" id="query">
并用

window.location.href = "http://site.com/" + query;
当我单击按钮onclick=“func();”时会发生这种情况

当我有一个常规的.html文件时,它可以工作,但当我把它放入我的Chrome扩展名时,它不会重定向。它甚至什么都没做

我试着把

chrome.tabs.create( { url: "http://www.site.com"} );
到我的函数中,但它也不会加载它。 我的manifest.json

"permissions": [
    "tabs"
]
谢谢

这会有帮助的
"permissions": [
    "tabs"
]