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

Fix: issue #220 #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pxer.util.getIDfromURL = function (key = 'id', url = document.URL) {
if (result) return result;

// read id from url
const matchResult = url.match(/\d{4,}/);
const matchResult = url.match(/\d+/);
Copy link
Owner

Choose a reason for hiding this comment

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

这里有个考虑是,URL里面有可能有别的数字。页码。改成+后会不会把页码识别成id?

Copy link
Author

Choose a reason for hiding this comment

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

应该要梳理一下现在新版p站各个页面的url和参数了, 有空我整理一下先看看


return matchResult ? matchResult[0] : null;
};
Expand All @@ -237,4 +237,4 @@ pxer.util.fetchPixivApi = async function (url) {
).body;
};

Object.assign(window, pxer.util);
Object.assign(window, pxer.util);