简体   繁体   English

Microsoft Edge PDF 页面索引缓存 iframe 问题

[英]Microsoft Edge PDF Page Index Cache iframe Issue

Background: Microsoft Edge has a "Pick up where you left off" feature when a user is reading a PDF in the browser.背景:当用户在浏览器中阅读 PDF 时,Microsoft Edge 有一个“从你离开的地方继续”的功能。 This works well when the user opens a tab directly to the PDF - if the user scrolls to the 15th page, closes the tab, and then opens it again later, Edge automatically takes the user back to the 15th page.当用户直接打开一个选项卡到 PDF 时,这很有效——如果用户滚动到第 15 页,关闭选项卡,然后稍后再次打开它,Edge 会自动将用户带回第 15 页。 This works too if the user opens different PDFs in different tabs - Edge remembers the index for that specific PDF.如果用户在不同的选项卡中打开不同的 PDF,这也适用 - Edge 会记住该特定 PDF 的索引。

The problem is though when those different PDFs are opened within an iframe on a single webpage via Javascript. Opening one PDF, scrolling to page 15, closing that iframe (JS removes that iframe from the DOM), then opening a different PDF in an iframe will open that other PDF to page 15 also, which it shouldn't.问题是,当单个网页上通过Javascript在iframe中打开这些不同的PDF时也会将其他 PDF 打开到第 15 页,这是不应该的。 We want to maintain a separate cached index for each unique PDF.我们想为每个唯一的 PDF 维护一个单独的缓存索引。

It seems that Edge stores PDF index against the URL in the users browser window, not against the URL that appears in the iframe.似乎 Edge 在用户浏览器 window 中针对 URL 存储了 PDF 索引,而不是针对 iframe 中出现的 URL。

I understand this setting can be turned off within the browser, but I'm looking for a developer solution to prevent this from happening for users on the site.我知道可以在浏览器中关闭此设置,但我正在寻找开发人员解决方案来防止网站上的用户发生这种情况。

It should be possible to redirect the iFrame to a page even when resume at last position is active.即使 resume at last position 处于活动状态,也应该可以将 iFrame 重定向到页面。

I find if you do it manually you need to strike twice for it to be accepted as override so for example If I read to page 2 of 3 then on recall as page 3 it will try to go to page 2 but If I request frame page 3 twice it will then respect that.我发现如果您手动执行此操作,则需要敲击两次才能被接受为覆盖,例如,如果我阅读第 2 页,共 3 页,然后在回忆第 3 页时,它将尝试 go 到第 2 页,但如果我请求框架页面3 两次它会尊重它。

So then the URL call needs to be那么 URL 电话需要

protocol://folder/filename.pdf#page=[number]
protocol://folder/filename.pdf#page=[number]

However in standalone test call I only needed to call once externally as fresh tab but then twice is no big issue anyway然而,在独立测试调用中,我只需要在外部调用一次作为新选项卡,但两次也不是什么大问题

"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" "file:///C:/Users/WDAGUtilityAccount/AppData/Local/Temp/MicrosoftEdgeDownloads/whatever.firefox.pdf#page=3"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM