Chrome extension with p5.js

131 views
Skip to first unread message

Kaj van Veen

unread,
May 26, 2022, 3:58:56 AM5/26/22
to Chromium Extensions
file 1 "extension.json":

{
  "manifest_version": 3,
  "name": "Wiktionary",
  "version": "1.0",
  "content_scripts": [{
    "matches": [
     "<all_urls>"
    ],
    "js": ["p5.js", "p5.dom.js", "sketch.js"]
  }]
}

-----------------------------------------------------------------------------------------------------------------

file 2 "index.html":

<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- PLEASE NO CHANGES BELOW THIS LINE (UNTIL I SAY SO) -->
  <script language="javascript" type="text/javascript" src="libraries/p5.min.js"></script>
  <script language="javascript" type="text/javascript" src="sketch.js"></script>
  <script language="javascript" type="text/javascript" src="extension.js"></script>
  <!-- OK, YOU CAN MAKE CHANGES BELOW THIS LINE AGAIN -->

  <!-- This line removes any default padding and style.
       You might only need one of these values set. -->
  <style> body { padding: 0; margin: 0; } </style>
</head>

<body>
</body>
</html>

-----------------------------------------------------------------------------------------------------------------

file 3 "sketch.json":

function setup() {
  let c = createCanvas(400, 400);
  c.position(0,0);
}

function draw(){
  background(0);
}

-----------------------------------------------------------------------------------------------------------------

I fixed all the errors that chrome extensions gave when I loaded the folder in but it is grayed out. Is it a problem with my code?

Robbi

unread,
May 26, 2022, 5:03:25 AM5/26/22
to Chromium Extensions, Kajva...@hotmail.com
I'd start to change "extension.json" in "manifest.json"
Reply all
Reply to author
Forward
0 new messages