New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 672563 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

PDF extension should not navigate current tab when PDF requests navigation

Project Member Reported by creis@chromium.org, Dec 8 2016

Issue description

Chrome Version: 57.0.2945.0, 55.0.2883.75
OS: Windows 10

What steps will reproduce the problem?
(1) data:text/html,<embed src="data:application/pdf,">
(2) Right click on the failed PDF embed and choose Inspect.
(3) In the DevTools opened for the GuestView, type:
    setTimeout(function () {chrome.tabs.update({url: "chrome://settings"});}, 5000);
(4) Before the 5 second timer finishes, switch to a different tab.

What is the expected result?
The tab with the PDF should navigate, not the new tab.

What happens instead?
The new (unrelated) tab navigates.

This was discovered in issue 661831, which only fixed part of the problem.  The PDF extension should be specifying a specific tab to navigate if it uses chrome.tabs.update to handle navigations triggered by the PDF.

(I'm not sure what script code is possible within a PDF, but if it can set timers and navigate, then this bug will be a problem.)

raymes@: Can you help triage and find an owner or fix?
 

Comment 1 by raymes@chromium.org, Dec 12 2016

Cc: raymes@chromium.org
Owner: mcnee@chromium.org
Thanks! 

mcnee@: would you be able to take a look at this? We basically just need to change chrome.tabs.update() in navigator.js to pass the tab ID in. 

Comment 2 by mcnee@chromium.org, Dec 13 2016

Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Dec 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cf2bc970b5ee619700cc1f334b4c2145cf0a5ab5

commit cf2bc970b5ee619700cc1f334b4c2145cf0a5ab5
Author: mcnee <mcnee@chromium.org>
Date: Wed Dec 14 18:57:54 2016

PDF viewer: Specify tabId when navigating with chrome.tabs.update.

Currently, the use of chrome.tabs.update to navigate defaults to using
the selected tab. If another tab is selected before the navigation is
performed, this other tab will be navigated instead of the PDF viewer's
tab.

We pass the viewer's tabId to chrome.tabs.update to ensure the correct
tab is navigated.

BUG= 672563 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2568903002
Cr-Commit-Position: refs/heads/master@{#438563}

[modify] https://crrev.com/cf2bc970b5ee619700cc1f334b4c2145cf0a5ab5/chrome/browser/pdf/pdf_extension_test.cc
[modify] https://crrev.com/cf2bc970b5ee619700cc1f334b4c2145cf0a5ab5/chrome/browser/resources/pdf/navigator.js
[modify] https://crrev.com/cf2bc970b5ee619700cc1f334b4c2145cf0a5ab5/chrome/browser/resources/pdf/pdf.js

Comment 4 by mcnee@chromium.org, Dec 14 2016

Status: Fixed (was: Started)

Sign in to add a comment