File tree Expand file tree Collapse file tree 1 file changed +11
-22
lines changed
modules/ROOT/partials/configuration Expand file tree Collapse file tree 1 file changed +11
-22
lines changed Original file line number Diff line number Diff line change @@ -21,26 +21,13 @@ The `+crossorigin+` option controls how {productname} handles cross-origin resou
2121[source,js]
2222----
2323tinymce.init({
24- selector: 'textarea',
25- crossorigin: (url, resourceType) => {
26- // Return 'anonymous' for all resources
27- return 'anonymous';
28- }
29- });
30- ----
31-
32- === Example: Conditional crossorigin attributes
33-
34- [source,js]
35- ----
36- tinymce.init({
37- selector: 'textarea',
38- crossorigin: (url, resourceType) => {
39- if (url.startsWith('https://your-domain.com')) {
40- return ''; // No crossorigin for same-origin resources
41- }
42- return 'anonymous'; // Use anonymous for cross-origin resources
43- }
24+ selector: "textarea",
25+ crossorigin: (url, resourceType) => {
26+ // Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
27+ return 'anonymous';
28+ // return 'use-credentials';
29+ // return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
30+ },
4431});
4532----
4633
@@ -75,8 +62,10 @@ The crossorigin function can also be set globally using `+tinymce.overrideDefaul
7562tinymce.overrideDefaults({
7663 ...tinymce.defaultOptions, // Preserve existing defaults
7764 crossorigin: (url, resourceType) => {
78- // Your custom crossorigin logic
79- return 'anonymous';
65+ // Returning 'anonymous' or 'use-credentials' here would explicitly set the attribute
66+ // return 'anonymous';
67+ // return 'use-credentials';
68+ return undefined; // Omit the 'crossorigin' attribute for all resources by returning undefined
8069 }
8170});
8271----
You can’t perform that action at this time.
0 commit comments