Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1469)

Unified Diff: chrome/browser/resources/pdf/browser_api.js

Issue 2407713002: Limit PDF helper extension to print preview only (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/browser_api.js
diff --git a/chrome/browser/resources/pdf/browser_api.js b/chrome/browser/resources/pdf/browser_api.js
index 90033b84085322370cabe103d2970fd738817a56..10a4ad370296f56697378b4390354080add48e2c 100644
--- a/chrome/browser/resources/pdf/browser_api.js
+++ b/chrome/browser/resources/pdf/browser_api.js
@@ -206,7 +206,7 @@ function createBrowserApiForStandaloneExtension() {
* current environment.
*/
function createBrowserApi() {
- if (window.location.search)
+ if (location.search && location.ancestorOrigins[0] === 'chrome://print')
raymes 2016/10/11 06:24:44 Do we need the window.location.search check too?
robwu 2016/10/11 21:05:38 Yes. When loaded inside the plugin location.ancest
return createBrowserApiForStandaloneExtension();
return createBrowserApiForMimeHandlerView();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698