Skip to content

Commit

Permalink
chore: remove unused safari nomodule fix (#37541)
Browse files Browse the repository at this point in the history
`safariNomoduleFix` was first introduced back in the year 2019 (#7704) as a part of the `modern` experimental feature. The experiment is ended and the feature is removed a year later in #19275. However, the unused `safariNomoduleFix` is never removed, until now.
  • Loading branch information
SukkaW committed Jun 8, 2022
1 parent 16fd15b commit 4077859
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -925,10 +925,6 @@ export class NextScript extends Component<OriginProps> {

context!: React.ContextType<typeof HtmlContext>

// Source: https://gist.github.com/samthor/64b114e4a4f539915a95b91ffd340acc
static safariNomoduleFix =
'!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()},!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();'

getDynamicChunks(files: DocumentFiles) {
return getDynamicChunks(this.context, this.props, files)
}
Expand Down

0 comments on commit 4077859

Please sign in to comment.