mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 14:23:25 +00:00
Enable TS strict mode and fix all associated errors
This commit is contained in:
@@ -15,12 +15,15 @@ interface Request extends BaseRequest {
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler<Request, BaseResponse> = async (req, res) => {
|
||||
try {
|
||||
if (!req.sender?.tab?.url) throw new Error('No tab URL found in the request.');
|
||||
if (!req.body) throw new Error('No request body found in the request.');
|
||||
|
||||
await assertDomainWhitelist(req.sender.tab.url);
|
||||
await setDynamicRules(req.body);
|
||||
res.send({
|
||||
success: true,
|
||||
});
|
||||
} catch (err) {
|
||||
} catch (err: any) {
|
||||
res.send({
|
||||
success: false,
|
||||
error: err.message,
|
||||
|
Reference in New Issue
Block a user