fix: make "People and body" category work in Firefox content script (#357)

Co-authored-by: Nolan Lawson <nolan@nolanlawson.com>
This commit is contained in:
dimden 2023-06-30 18:44:56 +03:00 committed by GitHub
parent d4365af442
commit b829d4c8ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,11 @@ export function cleanEmoji (emoji) {
if (!emoji) {
return emoji
}
// if inside a Firefox content script, need to clone the emoji object to prevent Firefox from complaining about cross-origin object
/* istanbul ignore if */
if (typeof wrappedJSObject !== 'undefined') {
emoji = structuredClone(emoji)
}
delete emoji.tokens
if (emoji.skinTones) {
const len = emoji.skinTones.length