Skip to content

Commit 91e545e

Browse files
authored
Update modules/ROOT/pages/8.0-release-notes.adoc
1 parent 56d06f7 commit 91e545e

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

modules/ROOT/pages/8.0-release-notes.adoc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,26 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
108108

109109
Added a new function-based `crossorigin` configuration option that provides granular control over cross-origin resource loading. The function receives the resource URL and type (script or stylesheet) as parameters and can return 'anonymous', 'use-credentials', or undefined to control the crossorigin attribute.
110110

111+
.Example: Setting `+crossorigin="anonymous"+` to script.
112+
[source,html,subs="attributes+"]
113+
----
114+
<script src="{cdnurl}" referrerpolicy="origin" crossorigin="anonymous"></script>
115+
----
116+
Or;
117+
118+
.Example: Setting reusable constant function.
111119
[source,js]
112120
----
113-
tinymce.init({
114-
selector: 'textarea',
115-
crossorigin: (url, resourceType) => {
121+
const crossOriginFunction = (url, resourceType) => {
116122
// Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
117123
return 'anonymous';
118124
// return 'use-credentials';
119-
// return undefined; // Omit the 'crossorigin' attribute for all resources
120-
}
125+
// return undefined; // Omits the 'crossorigin' attribute for all resources by returning undefined
126+
};
127+
128+
tinymce.init({
129+
selector: "textarea",
130+
crossorigin: crossOriginFunction
121131
});
122132
----
123133

0 commit comments

Comments
 (0)