We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36a03ed commit d88b3f7Copy full SHA for d88b3f7
1 file changed
index.js
@@ -264,6 +264,8 @@ class Codeplus {
264
this.inactiveTabClass = options.inactiveTabClass || "inactive";
265
this.copyButtonClass = options.copyButtonClass || "";
266
267
+ this.nonce = options.nonce || null;
268
+
269
// this.onTabShown = options.onTabShown || (() => {});
270
this.renderTab = options.renderTab || (() => {});
271
this.renderCopyButton = options.renderCopyButton || (() => {});
@@ -340,6 +342,9 @@ class Codeplus {
340
342
insertCSS() {
341
343
let style = document.createElement("style");
344
style.innerHTML = css;
345
+ if (this.nonce) {
346
+ style.setAttribute("nonce", this.nonce);
347
+ }
348
document.head.appendChild(style);
349
}
350
onRememberTabSelection(name) {
0 commit comments