Closed mthstv closed 5 months ago
I actually resolved this issue by following this documentation: https://github.com/quasarframework/quasar/blob/d4ce905398f883a77d1bdeaad621dfc15ee260a9/docs/src/pages/quasar-cli/developing-browser-extensions/types-of-bex.md
I updated the repo, using the same iframe logic height: 0
to hide it and turns out I needed to add this line to my code.
I've noticed this is a recurring error for me, sometimes it keeps working and sometimes the background scripts can't send events to content scripts. Any ideas on why this could be happening?
I actually solved this issue, My manifest.json
file was wrongly configured, the one I'm using now is working properly, here it is if anyone has the same issue:
{
"manifest_version": 2,
"icons": {
"16": "icons/favicon-16x16.png",
"48": "icons/favicon-48x48.png",
"128": "icons/favicon-128x128.png"
},
"browser_action": {
"default_popup": "www/index.html#/popup"
},
"background": {
"scripts": ["background.js"],
"persistent": true
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["my-content-script.js"],
"css": ["assets/content.css"]
}
],
"permissions": ["<all_urls>", "storage", "tabs", "activeTab"],
"web_accessible_resources": ["*", "<all_urls>"],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';"
}
@mthstv I had similar issue in manifest v3, but not in v2. When you will migrate to v3, you may find similar problem. I still don't know how to solve and it is very hard to reproduce.
What happened?
I'm developing a BEX using popup and I need to append an iframe to the document body to display a modal.
I've developed a small example to show this behavior: https://github.com/mthstv/quasar-bex-popup-modal-example
When entering a new web page, the background script communicates with the content script just fine and the modal is opened and closed as expected. After a while on the page the background script hooks remains working but the content script is not responsive.
Not reaching content script
Reached content script
Any ideas what may be causing this?
What did you expect to happen?
The background script sending the event to the content script and displaying the iframe modal on the document body.
Reproduction URL
https://github.com/mthstv/quasar-bex-popup-modal-example
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
BEX Mode
Platforms/Browsers
No response
Quasar info output
Relevant log output
No response
Additional context
No response