Skip to content

Commit

Permalink
fix: electron remote problem, feat: support more version of electron
Browse files Browse the repository at this point in the history
  • Loading branch information
xihale committed Aug 7, 2023
1 parent d3122d1 commit 107ab1f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/lowebutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&'); // eslint-disable-line no-useless-escape
name = name.replace(/[\[\]]/g, '\\$&');

Check failure on line 7 in js/lowebutil.js

View workflow job for this annotation

GitHub Actions / build

Unnecessary escape character: \[
const regex = new RegExp(`[?&]${name}(=([^&#]*)|&|#|$)`);

const results = regex.exec(url);
Expand All @@ -23,7 +23,7 @@ function cookieGet(cookieRequest, callback) {
callback(cookie);
});
}
const remote = require('electron').remote; // eslint-disable-line
const remote = require('@electron/remote'); // eslint-disable-line
remote.session.defaultSession.cookies
.get(cookieRequest)
.then((cookieArray) => {
Expand All @@ -41,7 +41,7 @@ function cookieSet(cookie, callback) {
callback(arg1, arg2);
});
}
const remote = require('electron').remote; // eslint-disable-line
const remote = require('@electron/remote'); // eslint-disable-line
remote.session.defaultSession.cookies.set(cookie).then((arg1, arg2) => {
callback(null, arg1, arg2);
});
Expand All @@ -52,7 +52,7 @@ function cookieRemove(cookie, callback) {
callback(arg1, arg2);
});
}
const remote = require('electron').remote; // eslint-disable-line
const remote = require('@electron/remote'); // eslint-disable-line
remote.session.defaultSession.cookies
.remove(cookie.url, cookie.name)
.then((arg1, arg2) => {
Expand Down

0 comments on commit 107ab1f

Please sign in to comment.