Closed alex-polunochev-zz closed 5 years ago
Based on this thread https://github.com/tshaddix/webext-redux/issues/47 I implemented an alternative communication channel using onMessageExternal
, extensionId
parameter for chrome.runtime.sendMessage
and externally_connectable
rule in manifest file. Now the messages go through. But without using Redux.
With the same manifest configuration the errors posted above still persist when I try to create new Store
(with or without extensionId parameter).
@godd9170 could you share any additional information on what else you might have done to fix your problem (#47) besides what was published later in PR #49 and what I listed in the beginning of the post?
@alex-polunochev I'm afraid I don't remember much from that thread. I do know that #49 introduced everything I needed and passing that externalId allowed for communication from the .js
that was injected into the page.
What do you mean exactly with But without using Redux
?
@godd9170 Thanks anyway! I meant there that finally I reached the point where my injected React component can send messages to background. But that unfortunately I wasn't able to use this library that brings Redux store and actions to facilitate a better, more efficient type of communication and storage.
Hey @alex-polunochev - sorry that you're having issues.
Have you tried removing this.extensionId
from the call in store.js here? I'm wondering if the latest version of chrome does not like the "null" extension Id that we pass in the default props.
That said, I haven't seen the error on my side.
@tshaddix I actually figured out the problem and should close this ticket, as there's no problem with webext-redux
.
I was using the 3rd party boilerplate code for my extension that was injecting the script into the hosting web page via a chain of calls which led to breaking of the execution context. Thus chrome.runtime
was no longer providing an object to work with. After simplifying that execute-a-script-to-execute-a-script-to-inject-a-react-script flow and avoiding unneccessary steps, I managed to gain the control of the context back. Using webext-redux
without problem now.
Excellent - great!
webext-redux
version 2.0.2 Chrome Version 74.0.3729.131 (Official Build) (64-bit)Following the instructions from Readme. Configured the store in the background - can dispatch actions and can see store getting updated. Moving to the UI. Calling
const store = new Store()
from the content script injected to the webpage. It results in an error:or
Looks like a reincarnation of https://github.com/tshaddix/webext-redux/issues/134
When as an experiment I pass the extension id (copied value from
chrome://extensions
tab) in asI am getting a different error:
Am I doing it right? Any clues?