To create a Chrome extension for the GistLib website, you can use the following steps:
manifest.json
in the root of the folder, and add the following code:index.tsx414 chars16 lines
This defines the basic information for the extension, including the permissions it requires, how the extension is displayed in the browser UI, and the location of the popup HTML file.
icon16.png
and icon32.png
. These will be used as the extension icons.popup.html
in the root folder, and add the following code:index.tsx213 chars11 lines
This is the popup HTML file that will be displayed when the user clicks on the extension icon. It includes a button that will trigger the save to GistLib functionality.
popup.js
in the root folder, and add the following code:index.tsx411 chars10 lines
This code listens for the button click, and sends a message to the active tab in the browser to save the code snippet to GistLib.
content.js
in the root folder, and add the following code:index.tsx213 chars8 lines
This code listens for the message sent by the popup script, and triggers the save to GistLib functionality.
gistlibby LogSnag