mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 14:03:25 +00:00
always create dynamic rule for fetch request
This commit is contained in:
@@ -52,13 +52,11 @@ const handler: PlasmoMessaging.MessageHandler<Request, Response<any>> = async (r
|
||||
const url = makeFullUrl(req.body.url, req.body);
|
||||
await assertDomainWhitelist(req.sender.tab.url);
|
||||
|
||||
if (Object.keys(req.body.headers).length > 0) {
|
||||
await setDynamicRules({
|
||||
ruleId: MAKE_REQUEST_DYNAMIC_RULE,
|
||||
targetDomains: [new URL(url).hostname],
|
||||
requestHeaders: req.body.headers,
|
||||
});
|
||||
}
|
||||
await setDynamicRules({
|
||||
ruleId: MAKE_REQUEST_DYNAMIC_RULE,
|
||||
targetDomains: [new URL(url).hostname],
|
||||
requestHeaders: req.body.headers,
|
||||
});
|
||||
|
||||
const response = await fetch(url, {
|
||||
method: req.body.method,
|
||||
|
Reference in New Issue
Block a user