inject script

This commit is contained in:
go0p
2024-05-15 14:43:04 +08:00
committed by go0p
parent f6cf369b3a
commit 8cdd5605bc
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},