Skip to content

Commit dc317c2

Browse files
committed
Added static keyword to global properties of LeetCodeBrowser
1 parent fa7a574 commit dc317c2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/packages/LeetCodeBrowser/LeetCodeBrowser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ puppeteer.use(StealthPlugin());
77

88
export class LeetCodeBrowser extends LeetCodeEvents {
99
private static defaultOptions: PuppeteerLaunchOptions = {};
10-
private baseURL: string = "https://leetcode.com/";
11-
private loginURL: string = "https://leetcode.com/accounts/login";
10+
private static baseURL: string = "https://leetcode.com/";
11+
private static loginURL: string = "https://leetcode.com/accounts/login";
1212
private constructor(private options: PuppeteerLaunchOptions, private browser: Browser, private page: Page) {
1313
super();
1414
this.addBrowserEventListeners(browser);
@@ -24,7 +24,7 @@ export class LeetCodeBrowser extends LeetCodeEvents {
2424
}
2525

2626
public async goTo(path: String): Promise<void> {
27-
const urlPath = `${this.baseURL}problems/${path}`;
27+
const urlPath = `${LeetCodeBrowser.baseURL}problems/${path}`;
2828
try {
2929
await this.page.goto(urlPath, { waitUntil: "networkidle0" });
3030
} catch (error) {
@@ -46,7 +46,7 @@ export class LeetCodeBrowser extends LeetCodeEvents {
4646

4747
const inputDelay = 100;
4848

49-
await this.page.goto(this.loginURL, { waitUntil: "networkidle0" });
49+
await this.page.goto(LeetCodeBrowser.loginURL, { waitUntil: "networkidle0" });
5050
await this.page.type(loginInputID, username, { delay: inputDelay });
5151
await this.page.type(passwordInputID, password, { delay: inputDelay });
5252
try {
@@ -55,7 +55,7 @@ export class LeetCodeBrowser extends LeetCodeEvents {
5555
this.page.click(submitBtnID, { delay: inputDelay }),
5656
]);
5757
if (response) {
58-
if (response.url() === this.baseURL) {
58+
if (response.url() === LeetCodeBrowser.baseURL) {
5959
console.log("Logged into leetcode!");
6060
return;
6161
}

0 commit comments

Comments
 (0)