Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO-NOT-MERGE - This is a CI trigger #209

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ snykTask/coverage
.eslintcache
.ops
ops/deploy/dist
.dccache
build/
.vscode/
24 changes: 23 additions & 1 deletion ui/enhancer/snyk-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,29 @@ export class SnykReportTab extends Controls.BaseControl {
};

private fillReportIFrameContent = (content: string): void => {
(document.getElementById('iframeID') as HTMLDivElement).innerHTML = content;
const container = document.getElementById('iframeID') as HTMLDivElement;

// Create a temporary container to parse the HTML content
const temp = document.createElement('div');
temp.innerHTML = content;

// Clear the target container
while (container.firstChild) {
container.removeChild(container.firstChild);
}

// Process and append each element, handling scripts specially
while (temp.firstChild) {
const node = temp.firstChild;
if (node.nodeName === 'SCRIPT') {
const script = document.createElement('script');
script.textContent = (node as HTMLScriptElement).textContent;
script.async = false;
container.appendChild(script);
} else {
container.appendChild(node);
}
}
};
}

Expand Down