How to Customize Browser’s PDF Viewer Without Changing the URL in the Omnibox

I’m trying to develop a browser extension to customize the PDF preview page. In the Stack Overflow question Chrome Extension: How to show custom UI for a PDF file, the main author of the PDF.js Chrome extension provided an excellent answer on how to intercept PDF requests in webRequest and redirect them to a custom page. However, this method changes the URL displayed in the address bar.

Interestingly, the Google Scholar PDF Reader (available here) does not alter the URL in the omnibox when opening PDF files. How is this achieved? Could someone analyze this behavior or provide insights on how to implement a similar feature? Any help would be greatly appreciated!

I used CRX Viewer to examine the source code of the Google Scholar PDF Reader extension. I noticed that it has permissions for “webNavigation”, “webRequest”, “declarativeNetRequest”, “scripting”, “storage”, “offscreen”, and “clipboardWrite”. When accessing any page, it loads a script called contentscript-compiled.js.

Could someone provide guidance on how to maintain the original URL while customizing the PDF viewer, or suggest what I might be missing in my approach? Any advice would be greatly appreciated!