Skip to content

Commit 75cf183

Browse files
linesighttlin
authored andcommitted
Fix documentation feedback
1 parent c256a16 commit 75cf183

6 files changed

Lines changed: 30 additions & 159 deletions

File tree

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ OS | Python | 32bit | 64bit | Requirements
5757
--- | --- | --- | --- | ---
5858
Windows | 3.10 / 3.11 / 3.12 / 3.13 / 3.14 | No | Yes | Windows 10+
5959
Linux | 3.10 / 3.11 / 3.12 / 3.13 / 3.14 | No | Yes | Ubuntu 20.04+, Debian 11+
60-
Mac | 3.10 / 3.11 / 3.12 / 3.13 / 3.14 | No | Yes | macOS 10.15+
60+
Mac | 3.10 / 3.11 / 3.12 / 3.13 / 3.14 | No | Yes | macOS 12+ (Apple Silicon/arm64 only)
6161

6262

6363
## Examples
@@ -276,16 +276,13 @@ at this moment.
276276
* [GetClientCallback](api/Browser.md#getclientcallback)
277277
* [GetClientCallbacksDict](api/Browser.md#getclientcallbacksdict)
278278
* [GetFocusedFrame](api/Browser.md#getfocusedframe)
279-
* [GetFrame](api/Browser.md#getframe)
280279
* [GetFrameByIdentifier](api/Browser.md#getframebyidentifier)
281-
* [GetFrames](api/Browser.md#getframes)
282-
* [GetFrameCount](api/Browser.md#getframecount)
283-
* [GetFrameIdentifiers](api/Browser.md#getframeidentifiers)
280+
* [GetFrameByName](api/Browser.md#getframebyname)
284281
* [GetFrameNames](api/Browser.md#getframenames)
282+
* [GetFrames](api/Browser.md#getframes)
285283
* [GetImage](api/Browser.md#getimage)
286284
* [GetJavascriptBindings](api/Browser.md#getjavascriptbindings)
287285
* [GetMainFrame](api/Browser.md#getmainframe)
288-
* [GetNSTextInputContext](api/Browser.md#getnstextinputcontext)
289286
* [GetOpenerWindowHandle](api/Browser.md#getopenerwindowhandle)
290287
* [GetOuterWindowHandle](api/Browser.md#getouterwindowhandle)
291288
* [GetSetting](api/Browser.md#getsetting)
@@ -296,13 +293,10 @@ at this moment.
296293
* [GetZoomLevel](api/Browser.md#getzoomlevel)
297294
* [GoBack](api/Browser.md#goback)
298295
* [GoForward](api/Browser.md#goforward)
299-
* [HandleKeyEventAfterTextInputClient](api/Browser.md#handlekeyeventaftertextinputclient)
300-
* [HandleKeyEventBeforeTextInputClient](api/Browser.md#handlekeyeventbeforetextinputclient)
301296
* [HasDevTools](api/Browser.md#hasdevtools)
302297
* [HasDocument](api/Browser.md#hasdocument)
303298
* [Invalidate](api/Browser.md#invalidate)
304299
* [IsFullscreen](api/Browser.md#isfullscreen)
305-
* [IsLoading](api/Browser.md#isloading)
306300
* [IsPopup](api/Browser.md#ispopup)
307301
* [IsWindowRenderingDisabled](api/Browser.md#iswindowrenderingdisabled)
308302
* [LoadUrl](api/Browser.md#loadurl)
@@ -418,7 +412,6 @@ at this moment.
418412
* [VisitUrlCookies](api/CookieManager.md#visiturlcookies)
419413
* [SetCookie](api/CookieManager.md#setcookie)
420414
* [DeleteCookies](api/CookieManager.md#deletecookies)
421-
* [SetStoragePath](api/CookieManager.md#setstoragepath)
422415
* [FlushStore](api/CookieManager.md#flushstore)
423416
* [CookieVisitor (interface)](api/CookieVisitor.md#cookievisitor-interface)
424417
* [Visit](api/CookieVisitor.md#visit)
@@ -469,7 +462,6 @@ at this moment.
469462
* [IsFocused](api/Frame.md#isfocused)
470463
* [IsMain](api/Frame.md#ismain)
471464
* [IsValid](api/Frame.md#isvalid)
472-
* [LoadString](api/Frame.md#loadstring)
473465
* [LoadUrl](api/Frame.md#loadurl)
474466
* [Paste](api/Frame.md#paste)
475467
* [Redo](api/Frame.md#redo)
@@ -569,7 +561,6 @@ at this moment.
569561
* [RenderHandler (interface)](api/RenderHandler.md#renderhandler-interface)
570562
* [GetRootScreenRect](api/RenderHandler.md#getrootscreenrect)
571563
* [GetViewRect](api/RenderHandler.md#getviewrect)
572-
* [GetScreenRect](api/RenderHandler.md#getscreenrect)
573564
* [GetScreenPoint](api/RenderHandler.md#getscreenpoint)
574565
* [OnPopupShow](api/RenderHandler.md#onpopupshow)
575566
* [OnPopupSize](api/RenderHandler.md#onpopupsize)
@@ -581,7 +572,6 @@ at this moment.
581572
* [UpdateDragCursor](api/RenderHandler.md#updatedragcursor)
582573
* [Request (class)](api/Request.md#request-class)
583574
* [CreateRequest](api/Request.md#createrequest)
584-
* [IsReadOnly](api/Request.md#isreadonly)
585575
* [GetUrl](api/Request.md#geturl)
586576
* [SetUrl](api/Request.md#seturl)
587577
* [GetMethod](api/Request.md#getmethod)
@@ -596,19 +586,15 @@ at this moment.
596586
* [SetFlags](api/Request.md#setflags)
597587
* [GetFirstPartyForCookies](api/Request.md#getfirstpartyforcookies)
598588
* [SetFirstPartyForCookies](api/Request.md#setfirstpartyforcookies)
599-
* [GetResourceType](api/Request.md#getresourcetype)
600-
* [GetTransitionType](api/Request.md#gettransitiontype)
601589
* [RequestHandler (interface)](api/RequestHandler.md#requesthandler-interface)
602590
* [GetAuthCredentials](api/RequestHandler.md#getauthcredentials)
603591
* [GetResourceHandler](api/RequestHandler.md#getresourcehandler)
604592
* [OnBeforeBrowse](api/RequestHandler.md#onbeforebrowse)
605-
* [_OnBeforePluginLoad](api/RequestHandler.md#_onbeforepluginload)
606593
* [OnBeforeResourceLoad](api/RequestHandler.md#onbeforeresourceload)
607594
* [_OnCertificateError](api/RequestHandler.md#_oncertificateerror)
608595
* [OnQuotaRequest](api/RequestHandler.md#onquotarequest)
609596
* [OnResourceRedirect](api/RequestHandler.md#onresourceredirect)
610597
* [OnResourceResponse](api/RequestHandler.md#onresourceresponse)
611-
* [OnPluginCrashed](api/RequestHandler.md#onplugincrashed)
612598
* [OnProtocolExecution](api/RequestHandler.md#onprotocolexecution)
613599
* [OnRendererProcessTerminated](api/RequestHandler.md#onrendererprocessterminated)
614600
* [ResourceHandler (interface)](api/ResourceHandler.md#resourcehandler-interface)
@@ -626,7 +612,7 @@ at this moment.
626612
* [SetStatusText](api/Response.md#setstatustext)
627613
* [GetMimeType](api/Response.md#getmimetype)
628614
* [SetMimeType](api/Response.md#setmimetype)
629-
* [GetHeader](api/Response.md#getheader)
615+
* [GetHeaderByName](api/Response.md#getheaderbyname)
630616
* [GetHeaderMap](api/Response.md#getheadermap)
631617
* [GetHeaderMultimap](api/Response.md#getheadermultimap)
632618
* [SetHeaderMap](api/Response.md#setheadermap)

api/API-index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
* [GetImage](Browser.md#getimage)
6161
* [GetJavascriptBindings](Browser.md#getjavascriptbindings)
6262
* [GetMainFrame](Browser.md#getmainframe)
63-
* [GetNSTextInputContext](Browser.md#getnstextinputcontext)
6463
* [GetOpenerWindowHandle](Browser.md#getopenerwindowhandle)
6564
* [GetOuterWindowHandle](Browser.md#getouterwindowhandle)
6665
* [GetSetting](Browser.md#getsetting)
@@ -71,8 +70,6 @@
7170
* [GetZoomLevel](Browser.md#getzoomlevel)
7271
* [GoBack](Browser.md#goback)
7372
* [GoForward](Browser.md#goforward)
74-
* [HandleKeyEventAfterTextInputClient](Browser.md#handlekeyeventaftertextinputclient)
75-
* [HandleKeyEventBeforeTextInputClient](Browser.md#handlekeyeventbeforetextinputclient)
7673
* [HasDevTools](Browser.md#hasdevtools)
7774
* [HasDocument](Browser.md#hasdocument)
7875
* [Invalidate](Browser.md#invalidate)
@@ -354,7 +351,6 @@
354351
* [UpdateDragCursor](RenderHandler.md#updatedragcursor)
355352
* [Request (class)](Request.md#request-class)
356353
* [CreateRequest](Request.md#createrequest)
357-
* [IsReadOnly](Request.md#isreadonly)
358354
* [GetUrl](Request.md#geturl)
359355
* [SetUrl](Request.md#seturl)
360356
* [GetMethod](Request.md#getmethod)

api/Browser.md

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,6 @@ Table of contents:
9494

9595
## Notes
9696

97-
Methods available in upstream CEF which were not yet exposed in CEF Python
98-
(see src/include/cef_browser.h):
99-
100-
* ImeSetComposition
101-
* ImeCommitText
102-
* ImeFinishComposingText
103-
* ImeCancelComposition
104-
* GetFrameCount
105-
* GetFrameIdentifiers
106-
* GetNSTextInputContext (Mac, OSR)
107-
* HandleKeyEventAfterTextInputClient (Mac, OSR)
108-
* HandleKeyEventBeforeTextInputClient (Mac, OSR)
109-
* IsLoading
110-
11197
There are some edge cases when after the OnBeforeClose event browser objects
11298
are no more globally referenced thus a new instance is created that
11399
wraps upstream CefBrowser object. Browser objects that were globally

api/cefpython.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -396,19 +396,12 @@ You must call this function so that CEF shuts down cleanly. Remember also to del
396396
Global unraisable hook, companion to [ExceptHook](#excepthook). Assign it
397397
with `sys.unraisablehook = cef.UnraisableHook`.
398398

399-
CEF Python's callback handlers are compiled with Cython and declared as
400-
"noexcept", so an exception must not propagate out of a handler into CEF's
401-
C++ code. Handlers catch their own exceptions and forward them to
402-
`sys.excepthook`, but if an exception still escapes a handler (for example a
403-
handler not wrapped in try/except, or whose except block itself raises) then
404-
Python reports it through
399+
Python reports some exceptions through
405400
[sys.unraisablehook](https://docs.python.org/3/library/sys.html#sys.unraisablehook)
406-
rather than crashing the process. By default that only prints to stderr and
407-
is easy to miss.
401+
rather than `sys.excepthook`. By default these exceptions are printed only to
402+
stderr and are easy to miss.
408403

409-
This hook forwards the escaped exception to [ExceptHook](#excepthook), so it
410-
is written to the "error.log" file, printed, and CEF is shut down cleanly -
411-
same as any other Python exception. Reaching this code path indicates a bug
412-
in a handler that should be fixed.
404+
This hook forwards the exception to [ExceptHook](#excepthook), so it is
405+
written to the "error.log" file, printed, and CEF is shut down cleanly.
413406

414407
See also Tutorial: [Handling Python exceptions](../docs/Tutorial.md#handling-python-exceptions).

docs/Migration-guide.md

Lines changed: 10 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ Table of contents:
5252
* [v66+ Changes to Mac apps that integrate into existing message loop (Qt, wxPython)](#v66-changes-to-mac-apps-that-integrate-into-existing-message-loop-qt-wxpython)
5353
* [v66.1+ Navigation urls passed to CreateBrowserSync or LoadUrl methods need to be encoded by app code](#v661-navigation-urls-passed-to-createbrowsersync-or-loadurl-methods-need-to-be-encoded-by-app-code)
5454
* [v67+ Do not call the 'WindowUtils.OnSize' function](#v67-do-not-call-the-windowutilsonsize-function)
55-
* [v147+ Python and platform requirements](#v147-python-and-platform-requirements)
56-
* [v147+ Build and packaging workflow rewritten](#v147-build-and-packaging-workflow-rewritten)
57-
* [v147+ Building CEF from sources is untested](#v147-building-cef-from-sources-is-untested)
58-
* [v147+ C++ to Python callbacks are now declared "noexcept"; add sys.unraisablehook](#v147-c-to-python-callbacks-are-now-declared-noexcept-add-sysunraisablehook)
59-
* [v147+ Cython 3 (language_level "3str") does not change any public string types](#v147-cython-3-language_level-3str-does-not-change-any-public-string-types)
55+
* [v147+ Register sys.unraisablehook](#v147-register-sysunraisablehook)
6056
* [v147+ Removed and changed APIs](#v147-removed-and-changed-apis)
6157

6258

@@ -185,7 +181,7 @@ its implementation in `src/dpi_aware_win.pyx`.
185181
## v49 (Win) Do not call the 'WindowUtils.OnSize' function
186182

187183
This function can sometimes cause app hanging during window resize.
188-
Call instead the new `WindowUtils`.[UpdateBrowserSize](../api/WindowUtils.md#updatebrowsersize)
184+
Call instead the new `WindowUtils.UpdateBrowserSize`
189185
function. Except when you use the `pywin32.py` example, in such case
190186
`WindowUtils.OnSize` must be called.
191187
See [Issue #464](../../../issues/464) for more details.
@@ -383,7 +379,7 @@ CEF v55 was the last version to support MacOS 10.7.
383379
## v57.1+ High DPI support on Windows
384380

385381
The `cef.DpiAware.SetProcessDpiAware` function is now deprecated.
386-
Use cef.DpiAware.[EnableHighDpiSupport](../api/DpiAware.md#enablehighdpisupport)
382+
Use `cef.DpiAware.EnableHighDpiSupport`
387383
function instead.
388384

389385
The ApplicationSettings.[auto_zooming](../api/ApplicationSettings.md#auto_zooming)
@@ -465,7 +461,7 @@ cef.Request.[GetFlags](../api/Request.md#getflags) method.
465461

466462
## v66+ RequestHandler.GetCookieManager not getting called in some cases
467463

468-
In some cases the RequestHandler.[GetCookieManager](../api/RequestHandler.md#getcookiemanager)
464+
In some cases the `RequestHandler.GetCookieManager`
469465
callback is not getting called due to a race condition.
470466
This bug is to be fixed in Issue [#429](../../../issues/429).
471467

@@ -507,78 +503,17 @@ The `cef.GetNavigateUrl` function was removed from the cefpython3 module.
507503
## v67+ Do not call the 'WindowUtils.OnSize' function
508504

509505
This function can sometimes cause app hanging during window resize.
510-
Call instead the new `WindowUtils`.[UpdateBrowserSize](../api/WindowUtils.md#updatebrowsersize)
506+
Call instead the new `WindowUtils.UpdateBrowserSize`
511507
function. Except when you use the `pywin32.py` example, in such case
512508
`WindowUtils.OnSize` must be called.
513509
See [Issue #464](../../../issues/464) for more details.
514510

515511

516-
## v147+ Python and platform requirements
512+
## v147+ Register sys.unraisablehook
517513

518-
CEF Python v147 supports CPython 3.10 through 3.14. Python 2 and Python 3.9 or
519-
older are no longer supported. All supported builds are 64-bit:
520-
521-
| Platform | Supported target |
522-
| --- | --- |
523-
| Windows | Windows 10 or later, x64 |
524-
| Linux | x64 (CI builds and tests on Ubuntu 24.04) |
525-
| macOS | macOS 12 or later, Apple Silicon/arm64 |
526-
527-
Windows and Linux 32-bit builds and macOS Intel/x86_64 builds are no longer
528-
produced or tested. The Windows compile target was raised from Windows 7 to
529-
Windows 10 (`WINVER`, `_WIN32_WINNT`, and `NTDDI_VERSION`) because the
530-
underlying CEF/Chromium 147 binaries already require Windows 10 or later.
531-
532-
533-
## v147+ Build and packaging workflow rewritten
534-
535-
Jumping from v66/v67 to v147 also means a full rewrite of the build and
536-
packaging workflow. The legacy Makefile/setup.py and
537-
`tools/make_installer.py` flow was replaced by:
538-
539-
1. `tools/download_cef.py` to download and verify the CEF distribution.
540-
2. `tools/automate.py --prebuilt-cef` to prepare the downloaded SDK.
541-
3. `tools/build.py` to drive an incremental CMake build.
542-
4. `tools/build_distrib.py` to package the staged files as a wheel.
543-
544-
The helper scripts `automate.py` and `build.py` are still part of the current
545-
workflow; they were rewritten rather than superseded. Although
546-
`pyproject.toml` declares scikit-build-core as its build backend, the supported
547-
workflow used by CI currently invokes CMake and `build_distrib.py` directly.
548-
See the rewritten [Build instructions](Build-instructions.md).
549-
550-
This is a build-time-only change and does not by itself affect the runtime
551-
Python API.
552-
553-
554-
## v147+ Building CEF from sources is untested
555-
556-
`tools/automate.py --build-cef`, which builds CEF/Chromium itself from
557-
sources, is not tested or supported as of v147 - it was last verified
558-
working with much older CEF versions (v56 on Linux, v50 on Windows). The
559-
supported path is downloading with `tools/download_cef.py` and then preparing
560-
the binaries with `tools/automate.py --prebuilt-cef` (see
561-
[Build instructions](Build-instructions.md)).
562-
563-
564-
## v147+ C++ to Python callbacks are now declared "noexcept"; add sys.unraisablehook
565-
566-
CEF Python's C++ to Python callback bridges (compiled with Cython) are now
567-
declared `noexcept` instead of `except *`. This includes client handlers as
568-
well as task, visitor, and web-request callbacks. These callbacks already
569-
catch their own exceptions and forward them to `sys.excepthook`, so normal
570-
application code is unaffected. The difference only shows up when an
571-
exception escapes that guard (for example, a callback missing a try/except or
572-
whose except block itself raises): previously that left CPython's error
573-
indicator set with nothing to consume it, so the error could resurface later
574-
as an unrelated, confusing failure; now Python reports it once, immediately,
575-
through
576-
[sys.unraisablehook](https://docs.python.org/3/library/sys.html#sys.unraisablehook)
577-
- which by default only prints to stderr and is easy to miss.
578-
579-
To give these exceptions the same treatment as any other CEF Python error
580-
(written to "error.log", printed, clean CEF shutdown), set the new hook
581-
alongside `sys.excepthook` during application startup:
514+
Register `cef.UnraisableHook` alongside `cef.ExceptHook` during application
515+
startup so that Python exceptions which cannot be raised normally receive the
516+
same logging and shutdown handling as other CEF Python errors:
582517

583518
```python
584519
sys.excepthook = cef.ExceptHook
@@ -587,22 +522,7 @@ sys.unraisablehook = cef.UnraisableHook
587522

588523
See cef.[UnraisableHook](../api/cefpython.md#unraisablehook) and
589524
[Tutorial > Handling Python exceptions](Tutorial.md#handling-python-exceptions)
590-
for details. Note that `sys.unraisablehook` is Python's own global hook and
591-
also fires for unrelated unraisable exceptions in your application (for
592-
example errors in `__del__` or garbage collection), not just for CEF Python
593-
callbacks.
594-
595-
596-
## v147+ Cython 3 (language_level "3str") does not change any public string types
597-
598-
The CMake build explicitly invokes Cython with `--3str`, equivalent to
599-
`language_level="3str"`, instead of Cython 2.x's implicit
600-
`language_level=2`. This is a Cython *compile-time* setting that affects how
601-
string/bytes **literals inside `.pyx` source** are typed by the compiler - it
602-
does not change the type of any value returned by, or passed into, the public
603-
`cefpython3` Python API. Strings crossing the Python/CEF boundary still go
604-
through the same `PyToCefString`/`CefToPyString` conversions as before and are
605-
still plain Python `str` on the Python side.
525+
for details.
606526

607527

608528
## v147+ Removed and changed APIs
@@ -614,9 +534,7 @@ most important application-facing changes are:
614534
| --- | --- |
615535
| `Browser.GetFrame(name)` | Renamed to `Browser.GetFrameByName(name)`. |
616536
| `Browser.GetFrameByIdentifier(int)` | Frame identifiers are now strings. |
617-
| `Browser.GetFrameCount()` / `GetFrameIdentifiers()` | Use `GetFrameNames()` or `GetFrames()`. |
618537
| `Browser.Find(search_id, search_text, ...)` | The `search_id` argument was removed. |
619-
| `Browser.IsLoading()` | Track `is_loading` in `LoadHandler.OnLoadingStateChange`. |
620538
| `Browser.SendFocusEvent(focus)` | Kept as a compatibility alias; new code should use `SetFocus(focus)`. |
621539
| `Browser.SetMouseCursorChangeDisabled()` / `IsMouseCursorChangeDisabled()` | Removed with no direct replacement. |
622540
| `Frame.LoadString(value, url)` | Use `Frame.LoadUrl()` with a `data:` URL. |

0 commit comments

Comments
 (0)