0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Fixed search script element detection

refs https://github.com/TryGhost/Team/issues/1665
refs b996eadbd4

- The search script injected by Ghost will be identified by `data-sodo-search` data attribute.
This commit is contained in:
Naz 2022-07-04 16:46:27 +02:00
parent 4a65cc6833
commit ec3d0b27cd

View file

@ -15,9 +15,9 @@ function getSiteData() {
/** /**
* @type {HTMLElement} * @type {HTMLElement}
*/ */
const scriptTag = document.querySelector('script[data-ghost-search]'); const scriptTag = document.querySelector('script[data-sodo-search]');
if (scriptTag) { if (scriptTag) {
const siteUrl = scriptTag.dataset.ghostSearch; const siteUrl = scriptTag.dataset.sodoSearch;
const apiKey = scriptTag.dataset.key; const apiKey = scriptTag.dataset.key;
const apiUrl = scriptTag.dataset.api; const apiUrl = scriptTag.dataset.api;
return {siteUrl, apiKey, apiUrl}; return {siteUrl, apiKey, apiUrl};