/ChromeExtension0

Primary LanguageJavaScriptMIT LicenseMIT

ChromeExtension0

Considerations

  • The extension wouldn't have been benefited by utilization of a framework like Next.js or react at this demonstration level, so It has been omitted.
  • There is a way to include user-identity in the extension using the Chrome Web Store IDs as the Client ID for the extension, but it is not free and requires a Developer Account, and so hasn't been implemented. Instead, it is generated by chrome's extension devtools.
  • The calculated Extension ID is : hhmkanjkpifpnojlmgkkgdkhdnkhhhji
  • OAuthClientID: 583176469710-psrn8f83nvojpdab0kuiv4s790gvh0eo.apps.googleusercontent.com
  • The extension is kept very basic as to not use up a lot of time.

How it works

chrome.runtime.onInstalled is used to create a new collection if needed, a default doc is required so we simply put in a address of google.

The extension has a simple index page, and a service worker, both of which are entrypoints to vite.

index is the popup, contains the necessary code for saving a link and deleting it, and viewing the previously saved links

a private key, dist.pem is provided for signing the extension.

chrome.identity is used to get the user auth id, and is saved in the chrome.storage.sync zone for easy use.

we simply reload the page on any successful action as that allows the DB to be completely in sync with the app.

Instruction to install and use

  1. Clone or degit the repository

    git clone https://github.com/DevParapalli/ChromeExtension0.git

    OR

    npx -y degit https://github.com/DevParapalli/ChromeExtension0.git
  2. Go to the chrome extensions page : chrome://extensions

  3. Turn on developer mode, there should be a toggle on the left side of the page.

  4. In the repository folder, run

    pnpm install
    pnpm run build
  5. In the chrome extensions page, look for the button that says Load Unpacked. Click it and select the dist/ folder in the pop-up that opens.

  6. Once installed, you will need to sign in to the extension, a window will automatically pop up and allow you to sign in.

  7. Navigate to any other page, and use the extension as intended.

Assignment for Solocl Internship