adambullmer / vue-cli-plugin-browser-extension

Browser extension development plugin for vue-cli 3.0
GNU Lesser General Public License v3.0
427 stars 76 forks source link

@click event not working on options page #45

Closed kennedyoliveira closed 5 years ago

kennedyoliveira commented 5 years ago

Hello, I'm starting to use this plugin for a chrome extension and noticed that the @click event doesn't trigger in the options page components, but works fine in the popup page. Also if I set to not open the embedded way using open_in_tab = true it works.

Is there a way to make the @click trigger when open_in_tab = false? This is the default behavior if nothing is changed after installing this plugin.

adambullmer commented 5 years ago

I'm not completely certain if this behavior can be changed. It appears to be desired behavior as far as chrome or other browsers are concerned. I did a fairly brief search for click events on browser extensions, and the solutions either didn't work for me (adding new CSP policies, manually binding click event to element), or were impractical to try and bake into the plugin (inline script hashing).

You're probably better off keeping the modal style options for simple things, and your more complex interactions may need to be opened in a new tab. It appears that js is running fine, or else the options page would not render at all.

kennedyoliveira commented 5 years ago

Thanks for checking that @adambullmer, I tried some of the things you mentioned too without luck too. At least it works just fine opening a new tab so it's ok.