Add the command line option -- kiosk.
Another option can also be found: -- APP = <URL>. This option also enables full screen and automatically opens the specified URL.
Quote: http://www.kaoshijuan.net/blog/
After unremitting search, I finally found a post on stackoverflow and described that he used a strange method to solve this problem, that is, Chrome's kiosk mode and kiosk printing mode. When the browser starts, add the-kiosk-printing parameter to the end to enter this mode. In this mode, apart from the page content, other such as the address bar, the toolbar buttons are gone and can only be closed by Alt F4. I guess this mode is used for demonstration, such as some special occasions. One advantage of this mode is that you do not need to confirm it again during the printing process. For example, if you make an automatic ticket purchase page, the ticketing machine is your printer, click the invoice on the page, and the ticket is immediately sent out of the printer. No printer setting box is required.
In this way, the page can be opened in full screen without confirmation.
Wait !!! If the screen is full, the browser action button that triggers content script will disappear. Do you still remember this?
What should I do?
We can place the button directly on the page. Since we can get Dom elements through content script, we can naturally modify DOM elements and insert a button.
Before that, we used buttons to trigger content Script Injection. If content script cannot be injected, how can we modify the Dom?
Do you still remember the two injection methods of content script? The first method is to call the executescript API of chrome. If it cannot be triggered, we can inject it in another way. This is to modify manifest. JSON and add the following configuration item.
"Content_scripts ":[
{
"Matches": ["http://XXX.oa.com/*"],
"JS": ["printall. js"],
"Run_at": "document_end"
}],
This configuration can inject the specified JS script into the page content. Matches is a matching item and is injected under a URL. JS indicates the injection file name. Run_at specifies the injection time. Here we need to get the Dom and add a button in the appropriate place after the page is loaded.
We added a line of code in printall. js.
$ ("# Ctl00_bodycontent_btnexport "). after ('<input type = "button" name = "printall" id = "printallid" value = "print all" id = "printall"> ');