Skip to content

Commit 65aacf8

Browse files
committed
處理 stayfork.app 不能用 .html#url= 問題
1 parent 7c4b25f commit 65aacf8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/app/service/service_worker/script.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class ScriptService {
201201
action: {
202202
type: "redirect" as chrome.declarativeNetRequest.RuleActionType,
203203
redirect: {
204-
regexSubstitution: `chrome-extension://${chrome.runtime.id}/src/script_installation_page.html#url=\\0`,
204+
regexSubstitution: `chrome-extension://${chrome.runtime.id}/src/script_installation_page.html?url=\\0`,
205205
},
206206
},
207207
condition: condition,

src/script_installation_page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const showError = (errorMessage: string) => {
1313
};
1414

1515
try {
16-
const urlParam = new URLSearchParams(location.hash.slice(1)).get("url");
16+
const urlParam = new URLSearchParams(location.search).get("url");
17+
// const urlParam = new URLSearchParams(location.hash.slice(1)).get("url");
1718
const isValidURL = (url: string) => {
1819
try {
1920
new URL(url);

0 commit comments

Comments
 (0)