D
D
Dmitry Skogorev2014-07-05 01:04:56
JavaScript
Dmitry Skogorev, 2014-07-05 01:04:56

Chrome extensions CSR. How to execute a function?

I have already read everything, but I can not find a clear answer and a solution to the problem
.

<input id="mysubmit" type="submit" value="submit" onclick="mycoolfunc()">

the mycoolfunc function is in a separate file, it is connected to <head> <script>, it is registered in the manifest, but due to the CSR, chrome does not allow the inline function to be executed
document.addEventListener('DOMContentLoaded', function () {
  document.getElementById('submitbutton').addEventListener('onclick', mycoolfunc);
});

doesn’t work or I’m doing something wrong
the documentation says about the sandbox, but what’s what - I can’t understand , tell
me, please

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question