


A complete list of available JS message names can be determined from the relevant PDFium source here from which it can be seen that advanced styling of the viewer, such as changing colours, isn't possible. Accessing an expanded API through content script messages can potentially be done if you know the available JavaScript messages. They are, as indicated above, quite limited, allowing the user to go directly to a page, set zoom factor, show thumbnails etc. The APIs you're having trouble finding simply don't exist.īasic API functions are some of those specified by Adobe in their Parameters for Opening PDF Files and are accessed through the URL (eg. The functionality available in the PDF viewer is (intentionally) fairly limited. In this discussion Mike West (Google/Chromium dev) states, in answer to a question on DOM accessibility in Chrome's PDF viewer: Instead you need to access an implemented API. In other words the PDF viewer uses a separate DOM to the page which is not directly accessible. As indicated here it is impossible to make modifications to this sort of plugin controlled content unless the plugin also adds a content script that allows the page to pass messages to the plugin the plugin must additionally be programmed to respond to messages and appropriately update the content. Because the plugin displays and controls content outside the scope of the current page's DOM, it can only be modified by the plugin. There is no way to directly style the Chrome default PDF viewer (PDFium).
