OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Quasar BEX get data from content to popup

  • Thread starter Thread starter Артем Булавин
  • Start date Start date
А

Артем Булавин

Guest
Goal sending event from app to content and get result of execution back From the doc we need to chain/relay the event calls w background ex: app > background > content/dom https://quasar.dev/quasar-cli-vite/...ensions/bex-communication#communication-rules

If you want to allow your Dev Tools, Popup or Options Page BEX to communicate with a web page, you will need to use the background script as a proxy. You would do this by:

Adding a listener on the background script which in turn emits another event. Add a listener to your Quasar App running in the Web Page context which listens for the event the background script is raising Emitting the event to your background script from your Dev Tools, Popup or Options Page.

So far we have tested the following scenarios that works/doesn't work, but we aren't really sure why.

Works

app > background - can use await to obtain the response background > content - can use await to obtain the response

Doesn't work

app > background > content using await (respond is called in content, and the result passed back by calling respond in background) - stuck with background await call, content received and respond called but never returned back to background

<p>Goal sending event from app to content and get result of execution back
From the doc we need to chain/relay the event calls w background ex: app > background > content/dom
<a href="https://quasar.dev/quasar-cli-vite/...ensions/bex-communication#communication-rules" rel="nofollow noreferrer">https://quasar.dev/quasar-cli-vite/...ensions/bex-communication#communication-rules</a></p>
<p>If you want to allow your Dev Tools, Popup or Options Page BEX to communicate with a web page, you will need to use the background script as a proxy. You would do this by:</p>
<p>Adding a listener on the background script which in turn emits another event.
Add a listener to your Quasar App running in the Web Page context which listens for the event the background script is raising
Emitting the event to your background script from your Dev Tools, Popup or Options Page.</p>
<p>So far we have tested the following scenarios that works/doesn't work, but we aren't really sure why.</p>
<p>Works</p>
<p>app > background - can use await to obtain the response
background > content - can use await to obtain the response</p>
<p>Doesn't work</p>
<p>app > background > content using await (respond is called in content, and the result passed back by calling respond in background) - stuck with background await call, content received and respond called but never returned back to background</p>
 

Latest posts

Top