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

Can't access popup DOM in chrome.runtime.onMessage #2

Open
leonma333 opened this issue Sep 17, 2017 · 0 comments
Open

Can't access popup DOM in chrome.runtime.onMessage #2

leonma333 opened this issue Sep 17, 2017 · 0 comments

Comments

@leonma333
Copy link
Member

in eighteenminus.js line 213 to send number of blocked images
chrome.runtime.sendMessage({event: 'number', number: imgBlocked}, function(response) {});

in popup.js line 61
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { if (request.event == 'number') $('p.number').find('strong').text(request.number); });

inside onMessage, we can't access background content DOM or even use console. However, the data sent from content page is correct, and alert can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants