📜  如何在扩展 chrome 中访问 URL - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:42.900000             🧑  作者: Mango

代码示例1
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => {
    let url = tabs[0].url;
    // use `url` here inside the callback because it's asynchronous!
});

//This requires that you request access to the chrome.tabs API in your extension manifest:

"permissions": [ ...
   "tabs"
]