Skip to content

Commit

Permalink
hijack finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Nov 8, 2024
1 parent e877f36 commit 835f39c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import crypto from "crypto";
import * as Sentry from "@sentry/browser";
import Document, { Head, Html, Main, NextScript } from "next/document";
import Script from "next/script";
import React from "react";

import { setErrorHandler } from "protocol/utils";
Expand Down Expand Up @@ -64,6 +65,25 @@ export default class MyDocument extends Document {
<meta httpEquiv="Content-Security-Policy" content={csp(this.props)} />
<link rel="stylesheet" href="/recording/fonts/inter/inter.css" />
<link rel="stylesheet" href="/recording/fonts/material_icons/material_icons.css" />
<Script
dangerouslySetInnerHTML={{
__html: `(${function () {
// @ts-expect-error
Promise.prototype.finally = function (callback) {
this.then(
result => {
callback && callback();
return result;
},
result => {
callback && callback();
throw result;
}
);
};
}.toString()})()`,
}}
></Script>
</Head>
<body>
<Main />
Expand Down

0 comments on commit 835f39c

Please sign in to comment.