1

Background

I developed a small chrome extension which is implemented as popup.html and popup.js (based on Google's provided sample). What I would like to do is implement the equivalent of an method such that when I click the extension icon, the popup.html is loaded and the popup.js therein is called, containing a someMethod() function. As of right now I observe no inline javascript executed at all upon page, even in placement of a script element with inline code.

Use

At a higher level, what I am trying to do is prepopulate values into the popup.html upon load based on data I have in localStorage whenever the extension is instantiated/clicked.

What I have tried that has not worked:

  • inline execution of javascript within popup.html

  • referenced ... in popup.html

  • a 'does it work at all' of ... in popup.html

Other notes

What I observe is that no javascript ever appears to be executed as referenced upon a popup.html / chrome extension instantiation. Am I missing something?

S. Bogdan
  • 53
  • 6
  • It's as simple as ``. More info about embedded scripts [here](https://stackoverflow.com/a/25721457). Also note, the popup has its own devtools, accessible by right-clicking inside the popup. – wOxxOm Jul 20 '19 at 17:34
  • Yes, operator error :( - I had a bug elsewhere I didn't realize. Thank you for your prompt response, it works! – S. Bogdan Jul 20 '19 at 17:48

1 Answers1

0

Operator error - I had a bug elsewhere I didn't realize, wOxxOm answer worked!

S. Bogdan
  • 53
  • 6