2

タイトルとして、このメソッドを Api に見つけることができません -> タブ...方法と場所は? ありがとう'

4

3 に答える 3

10

Chrome 16 で廃止されました。正しい方法は、 と を使用することchrome.tabs.queryです。active:truelastFocusedWindow:true

// Get the current active tab in the lastly focused window
chrome.tabs.query({
    active: true,
    lastFocusedWindow: true
}, function(tabs) {
    // and use that tab to fill in out title and url
    var tab = tabs[0];
    run({
        url: tab.url,
        description: tab.title
    });
});
于 2012-02-25T14:55:47.160 に答える
1

https://developer.chrome.com/extensions/tabs#method-getSelected

非推奨の方法ですが、引き続き使用できます。

chrome.tabs.getSelected(null, function(tab) {
  var url = tab.url;
});
于 2015-11-24T22:44:55.133 に答える
1

削除されました。代わりにchrome.tabs.queryを使用してください。

于 2012-02-25T14:51:10.627 に答える