inject script

This commit is contained in:
go0p
2024-05-08 14:48:02 +08:00
parent fbe662c056
commit c6234ae79c
4 changed files with 36 additions and 4 deletions
+5
View File
@@ -83,6 +83,11 @@ export class WebSocketManager {
getTabId().then((tabId) => {
// 确保tabId和code有效
if (typeof tabId === 'number' && typeof code === 'string') {
chrome.webNavigation.getAllFrames({tabId: tabId}, function(frames) {
for (let frame of frames) {
console.log(`Frame ID: ${frame.frameId} with URL: ${frame.url}`);
}
});
// 在指定的tabId上执行脚本
chrome.scripting.executeScript({
target: {tabId: tabId},