I appologize in advance for being a beginner, but I want to implement a button in my chrome extension that runs a javascript function that I have created.
Manifest file:
"manifest_version": 2,
"name": "Taylor's Test App",
"description": "This is a test app that will be changed.",
"version": "1.0.0",
"content_security_policy":"script-src 'self' https://apis.google.com;
object-src 'self'",
"icons": {"128": "supreme_logo.png"},
"browser_action":{
"default_icon": "supreme_logo.png",
"default_popup": "popup.html"
},
"permissions": ["identity", "https://accounts.google.com/*",
"https://www.googleapis.com/*"]
Html File:
<div class="modal-content">
<p>Supreme Bot</p>
</div>
<div>
<button type="button" id="supremebot">supremebot</button>
<script src="supremebot.js"></script>
</div>
Javascript file:
function supremeBot()
{
var ";
var email = "";
var tel = "";
var address = "";
var zip = "";
var city = "";
var state = "";
var country = "USA";
var ccn = "1111 1111 1111 1111";
var ccm = "04";
var ccy = "2021";
// Name
document.getElementById("order_billing_name").value= full_name;
// Email
document.getElementById("order_email").value= email;
// Phone #
document.getElementById("order_tel").value= tel;
// Address
document.getElementById("bo").value= address;
// Zip Code
document.getElementById("order_billing_zip").value= zip;
// City
document.getElementById("order_billing_city").value= city;
// State
document.getElementById("order_billing_state").value= state;
// Country
document.getElementById("order_billing_country").value= country;
// Credit Card Num
document.getElementById("nnaerb").value= ccn;
// Credit Card Month
document.getElementById("credit_card_month").value= ccm;
// Credit Card Year
document.getElementById("credit_card_year").value= ccy;
}
I have tried to run this before and it has given me 2 errors:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-95d8ph3GMGLjQcmKAitVhdvK6nQO58NNeLACLnFWhyQ='), or a nonce ('nonce-...') is required to enable inline execution
Refused to execute inline event handler because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.