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

Random OPF-018” warning being reported #1335

Closed
siddoib opened this issue May 30, 2022 · 8 comments
Closed

Random OPF-018” warning being reported #1335

siddoib opened this issue May 30, 2022 · 8 comments
Labels
status: completed Work completed, can be closed type: false-positive This issue is about valid content being incorrectly rejected
Milestone

Comments

@siddoib
Copy link

siddoib commented May 30, 2022

While using epubCheck version 4.2.6, I am getting the following warning randomly
WARNING(OPF-018): .\output\kit.epub:OEBPS/isbn-9780190064617-front-matter-part-4.xhtml (19,19): The "remote-resources" property was declared in the Package Document, but no reference to remote resources has been found.

Most of the lines (not all) where epubCheck is reporting the error usually has an HTML list (ul or ol) tag which I don’t believe has anything to do with remote-resources properties.

All the XHTML documents in the epub package has a javascript (<script src="scripts/analyticsCreator.js" type="text/javascript"></script>) which adds another external script to the page, therefore we declared the ‘remote-resources’ properties for all XHTML pages in the OPF file.

As I’ve said above, every page has the same scripts but only handful (most of the time with HTML list tag) are being flagged with the “OPF-018” warning which makes me wonder whether this is epubCheck bug rather than an issue with my epub package.

@mattgarrish
Copy link
Member

Epubcheck can't test what happens at runtime so as far as it can detect you don't have any remote resources references in the document. That's why it's warning you that applying the label appears to be incorrect.

I can't answer why it would report the issue in the file when it's the declaration in the package document that's at issue. I'm sure @rdeltour can speak to that.

But just note that what you're doing is technically invalid per the specification. You can't reference remote scripts for security reasons, so while writing the script tag dynamically might get you past epubcheck, it's still likely the script will be blocked by reading systems. They don't even all retrieve remote resources you're allowed to reference.

@siddoib
Copy link
Author

siddoib commented Jun 6, 2022

@mattgarrish, many thanks for you reply. I think what I can't get my head around is that the “OPF-018” warning only flags a handful XHTML files whilst every single one of them in my epub has the same script. “OPF-018” flags the file as many times as there are HTML list (ul or ol) tags in the documents.

The invalidity around the remote script is a compromise we had to make because our final epub files are intended for specifically tested platforms that we know will allow the remotely hosted script.

@rdeltour
Copy link
Member

rdeltour commented Jun 6, 2022

I think what I can't get my head around is that the “OPF-018” warning only flags a handful XHTML files whilst every single one of them in my epub has the same script. “OPF-018” flags the file as many times as there are HTML list (ul or ol) tags in the documents.

Could it be that theses files just happen to be the same files containing other remote resources that EPUBCheck does detect?

If you can share a sample here (privately is possible too: email me at rdeltour, Gmail), I can have a closer look 😊

@rdeltour rdeltour added status: waiting for feedback The development team needs feedback from the issue’s creator type: unverified The issue couldn't be reproduced labels Jun 6, 2022
@siddoib
Copy link
Author

siddoib commented Jun 6, 2022

@rdeltour, thanks for your help in advance. I have just sent you a sample file via the email address you mentioned above. let me know if you don't received it.

@rdeltour
Copy link
Member

Thanks @siddoib for the test case.

Something is apparently wrong with EPUBCheck:

  • OPF-018 is reported even when the content document contains scripting (in which case, only the USAGE-level OPF-018b message should be reported)
  • the error location is unrelated to the actual error

I'll need to dig deeper in the code to see why.

@rdeltour rdeltour added status: accepted Ready to be further processed type: false-positive This issue is about valid content being incorrectly rejected and removed status: waiting for feedback The development team needs feedback from the issue’s creator type: unverified The issue couldn't be reproduced labels Jun 20, 2022
@siddoib
Copy link
Author

siddoib commented Jun 20, 2022

Thanks @siddoib for the test case.

Something is apparently wrong with EPUBCheck:

* `OPF-018` is reported even when the content document contains scripting (in which case, only the `USAGE`-level `OPF-018b` message should be reported)

* the error location is unrelated to the actual error

I'll need to dig deeper in the code to see why.

@rdeltour, thanks for looking. All noted.

@siddoib
Copy link
Author

siddoib commented Nov 7, 2022

@rdeltour, any update on this issue? thanks again for your help.

@rdeltour rdeltour added this to the v5.0.0-beta milestone Nov 28, 2022
@rdeltour rdeltour added status: in progress The issue is being implemented by the development team and removed status: accepted Ready to be further processed labels Nov 28, 2022
@rdeltour rdeltour added status: completed Work completed, can be closed and removed status: in progress The issue is being implemented by the development team labels Dec 1, 2022
@rdeltour
Copy link
Member

rdeltour commented Dec 5, 2022

@rdeltour, any update on this issue? thanks again for your help.

This should be fixed in v5.0.0-beta-3! Thanks again for the report 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: completed Work completed, can be closed type: false-positive This issue is about valid content being incorrectly rejected
Projects
None yet
Development

No branches or pull requests

3 participants