Skip to content

Commit

Permalink
Merges in head elements
Browse files Browse the repository at this point in the history
  • Loading branch information
scuml committed Nov 30, 2023
1 parent 0178027 commit 78d8f52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/drive/page_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ export class PageRenderer extends Renderer {
const newElements = [...this.newHeadSnapshot.stylesheets]

for (const currentElement of currentElements) {
this.isCurrentElementInElementList(currentElement, newElements)
if (!this.isCurrentElementInElementList(currentElement, newElements) && !currentElement.hasAttribute("turbo-progress-bar")) {
document.head.removeChild(currentElement);
}
}

for (const element of newElements) {
Expand Down
2 changes: 2 additions & 0 deletions src/core/drive/progress_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export class ProgressBar {
const element = document.createElement("style")
element.type = "text/css"
element.textContent = ProgressBar.defaultCSS
element.setAttribute("turbo-progress-bar", "")

if (this.cspNonce) {
element.nonce = this.cspNonce
}
Expand Down

0 comments on commit 78d8f52

Please sign in to comment.