Код: Выделить всё
h.setAttribute('style', 'visibility: hidden;position: absolute; top: 0px; left: -999px;');
Код: Выделить всё
s.style.fontSize = 12px;
РЕДАКТИРОВАТЬ: Ниже приведена ошибка журнала консоли, которую я вижу в Chrome
< р>
Код: Выделить всё
file.js?ts=1731118161084:51 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://cdn.com". Either the 'unsafe-inline' keyword, a hash ('sha256-Aq7e5LGf4kZTmyqS7SqWaWXFaN/dvBB41GlMIGE1TF8='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.
Подробнее здесь: https://stackoverflow.com/questions/791 ... ine-styles