| 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..051a5aff5bcf490d7bb44f3e0111705a001c140e 100644
|
| --- a/chrome/browser/resources/pdf/browser_api.js
|
| +++ b/chrome/browser/resources/pdf/browser_api.js
|
| @@ -206,8 +206,12 @@ function createBrowserApiForStandaloneExtension() {
|
| * current environment.
|
| */
|
| function createBrowserApi() {
|
| - if (window.location.search)
|
| + if (location.search) {
|
| + if (location.ancestorOrigins[0] !== 'chrome://print') {
|
| + throw new Error('Refused to load the standalone extension.');
|
| + }
|
| return createBrowserApiForStandaloneExtension();
|
| + }
|
|
|
| return createBrowserApiForMimeHandlerView();
|
| }
|
|
|