Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fonts.lied is undefined #264

Open
shbobur opened this issue Apr 3, 2024 · 3 comments
Open

fonts.lied is undefined #264

shbobur opened this issue Apr 3, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shbobur
Copy link

shbobur commented Apr 3, 2024

The fonts.lied in the console is undefined.

image

I debugged the lie detection in fonts/index.ts:

...
		// detect lies
		const lied = (
			lieProps['FontFace.load'] ||
			lieProps['FontFace.family'] ||
			lieProps['FontFace.status'] ||
			lieProps['String.fromCodePoint'] ||
			lieProps['CSSStyleDeclaration.setProperty'] ||
			lieProps['CSS2Properties.setProperty']
		)

                console.log(lieProps['FontFace.load'])
		console.log(lieProps['FontFace.family'])
		console.log(lieProps['FontFace.status'])
		console.log(lieProps['String.fromCodePoint'])
		console.log(lieProps['CSSStyleDeclaration.setProperty'])
		console.log(lieProps['CSS2Properties.setProperty'])
...

all of these values are undefined. I couldn't figure out what might be the reason. Is this expected behaviour?

@abrahamjuliot abrahamjuliot added help wanted Extra attention is needed bug Something isn't working labels Apr 3, 2024
@abrahamjuliot
Copy link
Owner

It's needs fixing. It would be better to assign a boolean.

@shbobur
Copy link
Author

shbobur commented Apr 3, 2024

In other lie calculations, I saw the expression ... || false at the end. So would this be enough?

const lied = (
    lieProps['FontFace.load'] ||
    lieProps['FontFace.family'] ||
    lieProps['FontFace.status'] ||
    lieProps['String.fromCodePoint'] ||
    lieProps['CSSStyleDeclaration.setProperty'] ||
    lieProps['CSS2Properties.setProperty'])
    || false
)

@abrahamjuliot
Copy link
Owner

Yes, that works perfect.

shbobur added a commit to shbobur/creepjs that referenced this issue Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants