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

Make annotation of iframes opt-in #533

Merged
merged 3 commits into from
Sep 11, 2017
Merged

Conversation

robertknight
Copy link
Member

@robertknight robertknight commented Sep 7, 2017

It turns out that the client's iframe support is not yet robust enough (see #530) to enable it automatically for all same-origin iframes on arbitrary web pages.

To support the needs of EPUB viewers and others in the meantime while preventing problems on eg. pages with larger numbers of iframed ads, require the publisher to opt iframes into annotation by
adding the enable-annotation attribute to them.

Note that this doesn't fix the root issues described in #530 (comment) , but it does alleviate the symptoms on real-world websites until those issues are all addressed. Even when they are resolved, we will probably still want to use tougher heuristics before automatically enabling annotation for iframes because of the performance cost.

CC @jccr

Run `prettier` on `frame-util.js` to fix up some minor formatting
inconsistencies.
The client's iframe support is not yet robust enough (see
#530) to enable it
automatically for all iframes on arbitrary web pages.

To support the needs of EPUB viewers and others in the meantime while
preventing problems on eg. pages with larger numbers of iframed ads,
require the publisher to opt iframes into annotation by adding the
"enable-annotation" attribute to them.
@segdeha
Copy link

segdeha commented Sep 7, 2017

Rather than just requiring publishers to tag their iframes, could we not detect common ad sizes and ignore those frames? Most adverts are one of several sizes, most of which would be super unlikely to be a frame with content anyone wants to annotate.

@robertknight
Copy link
Member Author

Rather than just requiring publishers to tag their iframes, could we not detect common ad sizes and ignore those frames?

Fair question. We already apply some heuristics like that, but they weren't good enough and we don't have a lot of bandwidth to validate anything we do come up with thoroughly at present for compatibility, performance etc. This approach is dumb & conservative but predictable.

@sheetaluk sheetaluk assigned sheetaluk and unassigned sheetaluk Sep 7, 2017
@codecov
Copy link

codecov bot commented Sep 7, 2017

Codecov Report

Merging #533 into master will increase coverage by <.01%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
+ Coverage   90.93%   90.93%   +<.01%     
==========================================
  Files         136      136              
  Lines        5426     5428       +2     
  Branches      945      945              
==========================================
+ Hits         4934     4936       +2     
  Misses        492      492
Impacted Files Coverage Δ
src/annotator/util/frame-util.js 87.8% <85.71%> (+0.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4192f10...30475c0. Read the comment docs.

jccr added a commit to readium/readium-shared-js that referenced this pull request Sep 8, 2017
@sheetaluk sheetaluk merged commit 4fe8c71 into master Sep 11, 2017
@sheetaluk sheetaluk deleted the iframe-annotation-opt-in branch September 11, 2017 01:56
@robertknight
Copy link
Member Author

Thanks for testing this out @sheetaluk 🙂

jccr added a commit to readium/readium-shared-js that referenced this pull request Sep 11, 2017
jccr added a commit to readium/readium-shared-js that referenced this pull request Sep 11, 2017
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

Successfully merging this pull request may close these issues.

3 participants