Forum Academy Marketplace Showcase Pricing Features

Chrome Extension with Listeners - How to Access from Bubble to JS?

I’m using the Bubble to JS plugin in conjunction with a Chrome Extension I’ve built, and cannot seem to figure out how to get the two to talk to each other. I’ve spent hours on this today, including lots of web & forum research, and it’s turning my hair white. Please someone tell me what the heck I’m doing wrong. :pray:t2:

For reference, I’ve included screenshots at the bottom of this post

Context:

  1. Chrome Extension:
  • I’ve created a chrome extension that loads a bubble page using iframes (it is not yet on the extn store as it’s not yet working :slight_smile: )
  • Extension injects to the page it is loaded from & is loaded at the top of the DOM, so does not have direct access to the document body
  • I’ve created a listener on my background.js file, and a trigger on my content_script file, intended to extract text from a valid element ID (job-description) from the body on the source tab.
  • manifest has also been updated to allow external access to my page url
  • Code returns a constant called JobDescription, which I would like to send as text to my Bubble extension
  1. JS to Bubble:
  • Using plugin to define a Bubble function called bubble_fn_getheader()
  • value type = text
  • value published = true
  1. JS Workflow
  • Button on my chrome extension triggers an onClick event
  • Intent of the event is to pass the JobDescription from my extensions content_script file to the bubble_fn_getheader() function so it can be displayed in a text field on my extension

Issue
I believe step #3 above is where my issue lies, as I don’t seem to know how to access the JobDescription from the content_scripts and pass it into the bubble function.

Instead, when I call the function, i get an error that JobDescription is null. (Since I’m clearly not passing it into bubble correctly!) I’ve tried several ways of doing this beyond what is shown in the screen grab, which was sort of my last ditch effort, but haven’t landed on a winner yet.

How do i connect the dots and get this thing working?

Reference Screenshots:

background.js

content_scripts.js

JS to Bubble Plugin

JS Workflow

Error Message
error

bumping for interest :slight_smile: