Tag Archives: chromium

-WebKit margin before and extended browser prefix and kernel

-WebKit margin before is the definition method statement of article segment P container in css3.0.

Display: block only defines the P container as a block

And: – WebKit margin before/after: 1em — defines the upper margin and the lower margin of P respectively, which are 1 times the height of the font. If it is a 10px word, then the margin is 10px

-WebKit margin start/end: 0px — define the P container as 0px for both left and right margins.

In other words, in CSS3:

p {

display: block;

-webkit-margin-before:1em;

-webkit-margin-end:1em;

-webkit-margin-after:1em;

-webkit-margin-start:1em;

}

Equivalent to CSS2:

p {

display: block;

margin-top: 1em;

margin-right: 1em;

margin-bottom: 1em;

margin-left: 1em;

}

But because CSS3 requires a higher browser version, there is no popular CSS3 style in China, and CSS2 is still the mainstream, but it should be the world of CSS3 in the future, because it represents advanced technology.

browser kernel:

WebKit was originally an open source project of Apple company, and their own Safari was useful. Later, Google also built an open source browser project chromium with this typesetting engine and its own V8 JavaScript engine, and only made its own Chrome with this project. At the same time, the two browser cores on the mobile platform use WebKit. Thanks to chromium engine, there are also many WebKit browsers on PC platform: 360, window of the world, maple browser, sunflower browser, Sogou browser, roam 3 and Cheetah browser. Basically speaking, I’m a dual core, and I use chromium for any speed mode. Correspondingly, Microsoft’s IE uses the Trident typesetting engine, which is commonly known as the IE kernel. Firefox also has its own gecko typesetting engine. Apple’s iBooks also uses WebKit as the typesetting engine, while Sigil, the editing software, uses chromium, because it is also the WebKit kernel.

browser prefix:

Common: – WebKit – (chrome), –

     -moz-(Firefox)、

     -0-(Opera)、

     -ms-(IE)

Why a private prefix

W3C, the organization that formulates HTML and CSS standards, is very slow. Usually, members of W3C organizations put forward a new attribute, such as rounded border radius, which everyone thinks is good. However, W3C will not formulate standards for this attribute. Instead, it has to go through complex procedures and go through a lot of reviews. Browser vendors are not willing to wait so long. They think that an attribute is enough When you are familiar with it, you will add support to the browser. However, to avoid the W3C publishing the standard in the future, let the new version of the browser support the border radius attribute after the standard writing of border radius is established.

For example, chrome 10 doesn’t recognize the border radius writing method. It can only use – WebKit border radius, but chrome 12 can recognize it. Therefore, when writing CSS, it can ensure that the web pages of chrome 10 and 12 can be displayed normally.

Using CEF as user interface

Learn this, you can use local files to achieve a pure HTML, JavaScript and CSS (bootstrap) based user interface, and use it to operate the system

1、 Create a new folder in the project: HTML resources. Then copy the bootstrap file directory structure and content into it. And set the copy to output directory value of these files to copy always

2、 To display and manipulate index.html In the interface. Add button button to execute with JavaScript. (cefcustomobject is an instance of the operation class later)

<button class="btn btn-info" onclick="cefCustomObject.showDevTools();"&>Open Chrome Dev Tools</button&>
  <button class="btn btn-primary" onclick="cefCustomObject.opencmd();"&>Open cmd.exe</button&>

3. Create a new operation class (user target class) (click the button to perform the operation.) For example, opencmd method: open the CMD process

4、 In the constructor (1 — 4 is the same as using CEF as the browser)::

1. Cefsetting instantiation settings

2. Use CEF to initialize settings

3. Instantiate the chromiumwebbrower object (locally located) index.html (file)

4. Load this object into the control and set it to fill

5. The browser builds objects to register JS events. Binding instantiates the operation class.

6. Some browser properties are set by browersettings. Assigned to the browser.

Git source code address:

https://gitee.com/HuLuMiaoMiao/SecondCefSharp

Reference (some changes are easy to understand and some mistakes are made)

https://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application