Skip to content

Commit 99a873b

Browse files
committed
Use jsdeliver cdn for jupyter widgets dependencies
This PR replaces the use of cdnjs.cloudflare.com and unpkg.com with cdn.jsdelivr.net for jupyter widgets. The motivation is to bring more uniformity to JS CDN's for people defining content security policies for quarto websites. Since we already use jsdelivr for MathJax, Katex, and Algolia this brings Juptyer Widgets in line with those uses.
1 parent 852567d commit 99a873b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/jupyter/widgets.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ export function includesForJupyterWidgetDependencies(
101101
const head: string[] = [];
102102
if (haveJavascriptWidgets || haveJupyterWidgets) {
103103
head.push(
104-
'<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" integrity="sha512-c3Nl8+7g4LMSTdrm621y7kf9v3SDPnhxLNhcjFJbKECVnmZHTdo+IRO05sNLTH/D3vA6u1X32ehoLC7WFVdheg==" crossorigin="anonymous"></script>',
104+
'<script src="https://cdn.jsdelivr.net/npm/requirejs@2.3.6/require.min.js" integrity="sha384-c9c+LnTbwQ3aujuU7ULEPVvgLs+Fn6fJUvIGTsuu1ZcCf11fiEubah0ttpca4ntM" crossorigin="anonymous"></script>',
105105
);
106106
head.push(
107-
'<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous" data-relocate-top="true"></script>',
107+
'<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha384-ZvpUoO/+PpLXR1lu4jmpXWu80pZlYUAfxl5NsBMWOEPSjUn/6Z/hRTt8+pR6L4N2" crossorigin="anonymous"></script>',
108108
);
109109
head.push(
110110
"<script type=\"application/javascript\">define('jquery', [],function() {return window.jQuery;})</script>",
@@ -117,7 +117,7 @@ export function includesForJupyterWidgetDependencies(
117117
// jupyter widget runtime
118118
if (haveJupyterWidgets) {
119119
head.push(
120-
'<script src="https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js" crossorigin="anonymous"></script>',
120+
'<script src="https://cdn.jsdelivr.net/npm/@jupyter-widgets/html-manager@*/dist/embed-amd.js" crossorigin="anonymous"></script>',
121121
);
122122
}
123123

0 commit comments

Comments
 (0)