-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
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]>
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
Signed-off-by: Amit Lacher <[email protected]>
background-wrapper.js
Outdated
@@ -0,0 +1,23 @@ | |||
import * as background from '/background.js' |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
consts.js
Outdated
@@ -0,0 +1,4 @@ | |||
const SDAROT_USERNAME_KEY = 'sdarotUsername'; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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", { |
There was a problem hiding this comment.
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.
No description provided.