Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教一个问题!关于tabs.sendMessage #29

Open
zhurizhe opened this issue Dec 18, 2020 · 0 comments
Open

请教一个问题!关于tabs.sendMessage #29

zhurizhe opened this issue Dec 18, 2020 · 0 comments

Comments

@zhurizhe
Copy link

我在background里使用tabs.query获取tab,然后sendMessage,为什么会返回下面这个错误?
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.

 chrome.tabs.query({currentWindow:true},function(tabs){
        for(let i in tabs){
            chrome.tabs.sendMessage(tabs[i].id, {greeting: "hello"}, function(response) {
                console.log(response.farewell);
              });
        }
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant