Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for ES modules #1

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

AmitLacher
Copy link
Collaborator

No description provided.

AmitLacher added 8 commits May 6, 2023 23:05
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
@@ -0,0 +1,23 @@
import * as background from '/background.js'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the wrapper?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the wrapper is able to catch thrown errors any time anything invoked background.sdatortautoplay

helpers.js Outdated

const values = [];
for (const key in keys){
values.push(new Promise((res) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you push the value and new promise to the value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good question

manifest.json Show resolved Hide resolved
consts.js Outdated
@@ -0,0 +1,4 @@
const SDAROT_USERNAME_KEY = 'sdarotUsername';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add 'export' before the const declaration so you will be able to import like this - import {SDAROT_USERNAME_KEY } from './consts.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that, maybe we can get it to work, let me check

popup.js Outdated
}

const password = document.getElementById("sdarot-auto-password").value;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to insert it also to locator.js?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should

}

export const login = (username, password) => {
fetch("https://sdarot.buzz/login", {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to pass this function a baseURL of the current URL for this to work across multiple sites url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants