/popup allow header arg, with sanitization
| @@ -1908,7 +1908,9 @@ async function buttonsCallback(args, text) { | ||
| 1908 | 1908 | } |
| 1909 | 1909 | |
| 1910 | 1910 | async function popupCallback(args, value) { |
| 1911 | 1911 | const safeValuesafeBody = DOMPurify.sanitize(value || ''); |
| 1912 | + const safeHeader = args?.header && typeof args?.header === 'string' ? DOMPurify.sanitize(args.header) : null; | |
| 1913 | + | |
| 1912 | 1914 | /** @type {import('./popup.js').PopupOptions} */ |
| 1913 | 1915 | const popupOptions = { |
| 1914 | 1916 | large: isTrueBoolean(args?.large), |
| @@ -1918,7 +1920,7 @@ async function popupCallback(args, value) { | ||
| 1918 | 1920 | okButton: args?.okButton !== undefined && typeof args?.okButton === 'string' ? args.okButton : 'Ok', |
| 1919 | 1921 | cancelButton: args?.cancelButton !== undefined && typeof args?.cancelButton === 'string' ? args.cancelButton : null, |
| 1920 | 1922 | }; |
| 1921 | 1923 | await callGenericPopup(safeValue, POPUP_TYPEPopup.TEXTshow.text(safeHeader, ''safeBody, popupOptions); |
| 1922 | 1924 | return String(value); |
| 1923 | 1925 | } |
| 1924 | 1926 | |