mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-24 10:16:43 +08:00
* POC - FrontEnd remediations to handle Dynamic Data * Update modules/remediation/components/remediation-runner.php Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * added MutationObserver to cover elements that are added later on the page runs until remediations are all done, and disconnect * added $use_frontend flag instead of using "false" * Update modules/remediation/components/remediation-runner.php Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> * WIP on poc/fe-remediations * [APP-0000] call trigger save async * [APP-1644] apply FE remediation * [APP-1644] apply FE remediation * [APP-1644] apply FE remediation * Add timeout (wait for FE remediation timeout) * Add timeout (wait for FE remediation timeout) * Add timeout (wait for FE remediation timeout) * Add timeout (wait for FE remediation timeout) * Add timeout (wait for FE remediation timeout) * Small fixes * Small fixes * Small fixes * Small fixes --------- Co-authored-by: gitstream-cm[bot] <111687743+gitstream-cm[bot]@users.noreply.github.com> Co-authored-by: vasyldinets <vasyld@elementor.red>
15 lines
327 B
JavaScript
15 lines
327 B
JavaScript
export const getElementByXPath = (originXpath, context = document) => {
|
|
try {
|
|
const xpath = originXpath.replace('svg', "*[name()='svg']");
|
|
return document.evaluate(
|
|
xpath,
|
|
context,
|
|
null,
|
|
XPathResult.FIRST_ORDERED_NODE_TYPE,
|
|
null,
|
|
).singleNodeValue;
|
|
} catch (e) {
|
|
console.error(e);
|
|
return null;
|
|
}
|
|
};
|