Оно может быть либо подключено как распакованное, либо из магазина.
chrome.runtime.getURL('style.css')
. Путь задается от корня каталога расширения.injectCSSToPage (codeOrUrl, inline = true) {
if (inline) {
const style = document.createElement('style');
style.textContent = codeOrUrl;
document.head.appendChild(style);
} else {
const link = document.createElement('link');
link.href = codeOrUrl;
link.rel = 'stylesheet';
document.head.appendChild(link);
}
}
<?php
$content='"{\"orderId\":\"ORDER-294\",\"paymentState\":\"CANCELED\",\"signature\":\"naK+I79FduGkXFHpVT\/aJT31EfQ=\",\"message\":\"\u041a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b \u043e\u043f\u043b\u0430\u0442\u0443\",\"storeId\":\"158CC6EE85DA472AB3FB\"}"';
$res=json_decode(json_decode($content), true);
print_r($res);
/*Array
(
[orderId] => ORDER-294
[paymentState] => CANCELED
[signature] => naK+I79FduGkXFHpVT/aJT31EfQ=
[message] => Клиент не завершил оплату
[storeId] => 158CC6EE85DA472AB3FB
)
*/
document.addEventListener('click', async function (event) {
if (!event.target.matches('button.action, button.action *')) {
return;
}
})
document.addEventListener('click', evt => {
if (evt.target.matches('button.action, button.action *')) {
console.log('target', evt.target)
let button = evt.target.closest('button')
console.log('button', button)
}
})