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}
*/
const scriptTag = document.querySelector('script[data-ghost-search]');
const scriptTag = document.querySelector('script[data-sodo-search]');
if (scriptTag) {
const siteUrl = scriptTag.dataset.ghostSearch;
const siteUrl = scriptTag.dataset.sodoSearch;
const apiKey = scriptTag.dataset.key;
const apiUrl = scriptTag.dataset.api;
return {siteUrl, apiKey, apiUrl};