Chrome/chromium enable full screen (super full screen mode)

Source: Internet
Author: User

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"> ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.