fix: fix 614, 619. by cryptogun · Pull Request #620 · EdgeTranslate/EdgeTranslate · GitHub
Skip to content

fix: fix 614, 619.#620

Open
cryptogun wants to merge 1 commit into
EdgeTranslate:masterfrom
cryptogun:fix-shadowDOM
Open

fix: fix 614, 619.#620
cryptogun wants to merge 1 commit into
EdgeTranslate:masterfrom
cryptogun:fix-shadowDOM

Conversation

@cryptogun

Copy link
Copy Markdown

describe the bug/feature 解决的问题或新增的功能

fixes 614, 619.
PDF content will be displayed within a shadow DOM for Chrome newer versions, so we can't query within the PDF DOMs anymore to decide if it's managed by the builtin PDF viewer.

summary of code change 描述发生的改变

Current workaround is to check if this is a PDF file and if it's rendered by the builtin viewer (non extension).

新版本的Chrome内置pdf浏览器在显示pdf内容时,除了<body>等tag的字符,整个内部pdf内容是独立的。无法再通过js查询判断是不是内置pdf浏览器isChromePDFViewer().
目前的绕开方法是无脑判断文件(URL)是不是以.pdf结尾。并且这个URL不是插件(比如本插件)渲染的,那就说明是由内置pdf浏览器打开的了。

PDF content will be displayed within a shadow DOM for Chrome newer versions, so we can't query within the PDF DOMs anymore to decide if it's managed by the builtin PDF viewer. Current workaround is to check if this is a PDF file and if it's rendered by the builtin viewer (non extension).
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.

1 participant