One method to transfer information from a popup to the main content in a Chrome extension is through message passing using the chrome.runtime.sendMessage
and chrome.runtime.onMessage
API.
chrome.runtime.sendMessage
:chrome.runtime.sendMessage({data: info});
chrome.runtime.onMessage
:chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
if (message.data) {
// use the information from the message
}
});
chrome.runtime
API by including it in the permissions
section of the extension's manifest file:"permissions": [
"tabs",
"activeTab",
"storage",
"http://*/",
"https://*/",
"chrome://favicon/",
"chrome://extensions/",
"chrome://resources/"
]
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-02-23 11:00:00 +0000
Seen: 12 times
Last updated: Jan 21 '23
How can information be extracted by dividing a line?
What is the method to retrieve LegacyIAccessible information using UiAutomation?
What are some examples of entities in Microservice Architecture that have common properties?
What is the best approach to calculate pairwise mutual information using numpy?
What is the issue with the presentation of the final question?
In Flutter, what is the method to use for updating information in Firestore?
How can one turn off the debugging information in Tensorflow?