browserSettings.openSearchResultsInNewTabs

一个 BrowserSetting 对象,其底层值是布尔值。

如果设置为 true,当用户在浏览器的搜索框中选择一个项目时,搜索结果会显示在一个新标签页中。如果设置为 false(默认值),搜索结果会显示在当前标签页中。

注意,这不会影响从地址栏或智能地址栏中选择项目时的行为,只影响专用搜索框。

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
openSearchResultsInNewTabs

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

示例

将设置指定为 true

js
function logResult(result) {
  console.log(`设置已修改:${result}`);
}

browser.browserSettings.openSearchResultsInNewTabs
  .set({ value: true })
  .then(logResult);