-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Dictionary side panel example doesn't work with Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist. #1020
Comments
Hey @AlexMikhalev, thanks for flagging this. 😃 Out of curiosity, did you select the word "extensions", then right-click and choose the context menu Define? This sample has a long list of steps, it can be easily missed 😟 |
Yes. The point of a bug report is that we need working examples of how to pass data - even the string into the side panel with any reliability that our users will have it working in their environment. The case of nothing selected shall be handled too. |
The fix is to inject client-side script with chrome.runtime.sendMessage |
As someone who is floundering with the absolute paucity of good (ie, functioning) examples of V3 extensions, I'm hoping you can offer a bit more detail on this fix for this broken sample (I have the same issues) - is there any chance you could post the full updated source for the file in question, or indicate which file you mean by "client-side script" since I think there are two - both service-worker.js and sidepanel.js are "client-side", right? |
Hi chuck
You wouldn’t open the side panel with the extension action button. You open
the side panel by clicking on the side panel button that’s built into
Chrome.
https://support.google.com/chrome/answer/13156494?hl=en#zippy=%2Cuse-side-panel
…On Thu, Nov 16, 2023 at 6:16 AM Chuck Strusz ***@***.***> wrote:
I am having this same issue, but I'll note that the instructions in the
README, as written, *do not work*. To wit, Step 3 is "Open the side panel
UI" - but you *can't* open the side panel UI, because the extension
button is disabled (greyed out). I have tried this in a normal and an
incognito window with the same results.
[image: extension]
<https://user-images.githubusercontent.com/22245534/283445282-b9cbced5-f2a2-44c5-8e52-b42c868b9ea6.png>
—
Reply to this email directly, view it on GitHub
<#1020 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADRUBXLYFNY4AXZDVTCMXLYEX7ZXAVCNFSM6AAAAAA6KD3XIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGMZDSNZUGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
com>
|
@ChuckStrusz I was hoping Google Chrome's team would take ownership to ensure examples are working. As it stands now the example isn't going to work (by design):
than clientside_concepts.js:
than again in background js I have a part:
than in sidepanel.js
my extension runs cloudflare AI worker to translate English into Spanish. Service worker will not be able to communicate directly with sidepanel.js without clientside message. |
Oh my gosh! Thanks so much. I use the side panel so infrequently that I often forget it's there. |
I had the same issue after moving our extension to sidepanel, my contextual menus such as This is happening because the context menu needs to open the sidepanel and then send message to sidepanel page BUT this doesn't work as expected. The I found a workaround and seems to work for me but ideally I believe chrome.contextMenus.onClicked.addListener((info, tab) => {
chrome.sidePanel.open({ windowId: tab.windowId });
// wait for side panel to open - 500ms
setTimeout(() => {
if (!info.selectionText || !tab?.id) return;
const message = {
type: 'summarize-page',
data: { textContent: info.selectionText },
};
chrome.runtime.sendMessage(message);
}, 500);
}); |
Thanks all for the feedback. When we first launched That has changed of course, and I appreciate sending data can be a little awkward (we're talking about ways we might be able to simplify that). In the meantime, I've worked on an update which we can hopefully merge soon which demonstrates using the open API and also passing data using |
Describe the bug
Dictionary side panel example doesn't work with the error
in the service worker.
To Reproduce
"Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist."
Chrome:
Version 118.0.5993.70 (Official Build) (64-bit)
No other extensions or blockers are installed or active.
Expected behavior
Sidepanel appear
The text was updated successfully, but these errors were encountered: