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

[EXP] How to use chrome.tabs.onUpdated.addListener , chrome.tabs.onActivated.addListener #1115

Open
2 tasks done
thareekanvarm opened this issue Oct 22, 2024 · 0 comments
Open
2 tasks done
Labels
documentation Improvements or additions to documentation

Comments

@thareekanvarm
Copy link

thareekanvarm commented Oct 22, 2024

What is the example you wish to see?

Hi guys i want to know how can i handle this with plasmo messaging system please help me .

chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (stringStartsWithArrayValue(tab.url, urls)) {
if (changeInfo.url && !changeInfo.url.includes("#state")) {
chrome.tabs
.sendMessage(tabId, {
type: "CURRENT_URL",
url: changeInfo.url,
})
.catch((error) => console.error("Could not send message:", error));
}

if (changeInfo.status === "complete") {
  chrome.tabs
    .sendMessage(tabId, {
      type: "URL_CHANGED",
      url: changeInfo.url,
    })
    .catch((error) => console.error("Could not send message:", error));
}

}
});

im getting this error also

image

Is there any context that might help us understand?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@thareekanvarm thareekanvarm added the documentation Improvements or additions to documentation label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant