cvzi/Rottentomatoes-userscript

Firemonkey: Cannot update Algolia API key on rottentomatoes.com

Closed this issue · 0 comments

cvzi commented

Firemonkey cannot access the page variable RottenTomatoes i.e. window.RottenTomatoes

Seems to be this problem erosman/support#429 (comment)

So probably need to use unsafeWindow.RottenTomatoes

if (RottenTomatoes && 'thirdParty' in RottenTomatoes && 'algoliaSearch' in RottenTomatoes.thirdParty) {
if (typeof (RottenTomatoes.thirdParty.algoliaSearch.aId) === 'string' && typeof (RottenTomatoes.thirdParty.algoliaSearch.sId) === 'string') {
algoliaSearch.aId = RottenTomatoes.thirdParty.algoliaSearch.aId // x-algolia-application-id
algoliaSearch.sId = RottenTomatoes.thirdParty.algoliaSearch.sId // x-algolia-api-key
}
}