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

TypeError in contentscript? #342

Open
AroKol78 opened this issue Feb 25, 2023 · 2 comments
Open

TypeError in contentscript? #342

AroKol78 opened this issue Feb 25, 2023 · 2 comments

Comments

@AroKol78
Copy link

I get errors on some pages. Browser built on UXP.
error console:

Error: TypeError: The expression cannot be converted to return the specified type.
Source File: chrome://ublock0/content/js/contentscript.js
Line: 803

which indicates:

this.xpr = this.xpe.evaluate(

@gwarser
Copy link
Contributor

gwarser commented Feb 25, 2023

Perhaps it's about Xpath expression?

https://developer.mozilla.org/en-US/docs/Web/API/XPathExpression/evaluate#exceptions

@AroKol78
Copy link
Author

AroKol78 commented Feb 25, 2023

Thanks for a clarification. Looks like UXP issues.

thing for UXP developers

https://developer.mozilla.org/en-US/docs/Web/API/XPathExpression/evaluate#exceptions

Error: TypeError: Not enough arguments to XPathEvaluator.createExpression.
Source File: https://yari-demos.prod.mdn.mozit.cloud/en-US/docs/Web/API/XPathExpression/evaluate/_sample_.examples.html
Line: 52
thing for uBO developers

weird

  • does not cause this error and it worksblablabla.bla##:xpath(//a[not(contains(@href,','))][string-length(@href)>1600])
  • causes this error blablabla.bla##:xpath('//*[string-length(@href) > 1600]')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants