Greasy Fork is available in English.

Open the F**king URL Right Now

自动跳转某些网站不希望用户直达的外链

< Feedback on Open the F**king URL Right Now

Review: Good - script works

如果 URL 不以 / 结尾会自动加上 /, 然后就 404 了(部分网站)

临时解决方法是在 redirect 函数跳转之前加上

if (trueURL.endsWith('/')) {
      trueURL = trueURL.slice(0, -1); // 多了个 slice(0, -1) 以避免未曾预料的 / 的自动添加
  }

就是 258 行后面

OldPandaAuthor
§
Posted: 19.10.2023

谢谢指出!

OldPandaAuthor
§
Posted: 27.11.2023

如果 URL 不以 / 结尾会自动加上 /, 然后就 404 了(部分网站)

临时解决方法是在 redirect 函数跳转之前加上

if (trueURL.endsWith('/')) {
trueURL = trueURL.slice(0, -1); // 多了个 slice(0, -1) 以避免未曾预料的 / 的自动添加
}

就是 258 行后面

你好,方便给一个示例链接吗?我想详细了解一下这个问题,单纯地删掉末尾的 / 似乎并不能根治

Post reply

Sign in to post a reply.