You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logi('No activity in '+str(emrun_options.silence_timeout) +' seconds. Quitting web server with return code '+str(emrun_options.timeout_returncode) +'. (--silence-timeout option)')
542
+
logi(f'No activity in {emrun_options.silence_timeout}seconds. Quitting web server with return code {emrun_options.timeout_returncode}. (--silence-timeout option)')
543
543
page_exit_code=emrun_options.timeout_returncode
544
544
emrun_options.kill_exit=True
545
545
546
546
# If the page has been running too long as a whole, kill process.
logi('Page has not finished in '+str(emrun_options.timeout) +' seconds. Quitting web server with return code '+str(emrun_options.timeout_returncode) +'. (--timeout option)')
550
+
logi(f'Page has not finished in {emrun_options.timeout}seconds. Quitting web server with return code {emrun_options.timeout_returncode}. (--timeout option)')
logv('Web page has quit with a call to exit() with return code '+str(page_exit_code) +'. Shutting down web server. Pass --serve-after-exit to keep serving even after the page terminates with exit().')
717
+
logv(f'Web page has quit with a call to exit() with return code ${page_exit_code}. Shutting down web server. Pass --serve-after-exit to keep serving even after the page terminates with exit().')
718
718
# Set server socket to nonblocking on shutdown to avoid sporadic deadlocks
logv('Launched browser process with pid='+str(browser_process.pid))
1838
+
logv(f'Launched browser process with pid={browser_process.pid}')
1839
1839
ifoptions.kill_exit:
1840
1840
atexit.register(kill_browser_process)
1841
1841
# For Android automation, we execute adb, so this process does not
@@ -1847,7 +1847,7 @@ def run(cmd):
1847
1847
premature_quit_code=browser_process.poll()
1848
1848
ifpremature_quit_codeisnotNone:
1849
1849
options.serve_after_close=True
1850
-
logv('Warning: emrun got immediately detached from the target browser process (the process quit with exit code '+str(premature_quit_code) +'). Cannot detect when user closes the browser. Behaving as if --serve-after-close was passed in.')
1850
+
logv(f'Warning: emrun got immediately detached from the target browser process (the process quit with exit code {premature_quit_code}). Cannot detect when user closes the browser. Behaving as if --serve-after-close was passed in.')
1851
1851
ifnotoptions.browser:
1852
1852
logv('Try passing the --browser=/path/to/browser option to avoid this from occurring. See https://github.com/emscripten-core/emscripten/issues/3234 for more discussion.')
Copy file name to clipboardExpand all lines: site/source/docs/api_reference/html5.h.rst
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,54 @@ The ``useCapture`` parameter maps to ``useCapture`` in `EventTarget.addEventLis
90
90
91
91
Most functions return the result using the type :c:data:`EMSCRIPTEN_RESULT`. Zero and positive values denote success. Negative values signal failure. None of the functions fail or abort by throwing a JavaScript or C++ exception. If a particular browser does not support the given feature, the value :c:data:`EMSCRIPTEN_RESULT_NOT_SUPPORTED` will be returned at the time the callback is registered.
92
92
93
+
Unregister function
94
+
-------------------
95
+
96
+
In order to unregister a single event handler callback, call the following function:
const char *target, // ID of the target HTML element.
102
+
void *userData, // User-defined data (passed to the callback).
103
+
int eventTypeId, // The event type ID (EMSCRIPTEN_EVENT_XXX).
104
+
void *callback // Callback function.
105
+
);
106
+
107
+
108
+
The ``target``, ``userData`` and ``callback`` parameters are the same parameters provided in ``emscripten_set_some_callback`` with the only difference being that, since this function applies to all types of callbacks, the type of ``callback`` is ``void *``.
109
+
110
+
Note in particular that the value of ``userData`` will need to match with the call that was used to register the callback. If you are having trouble, double check the value of ``userData``.
111
+
112
+
The ``eventTypeId`` represents the event type, the same Id received in the callback functions.
113
+
114
+
The function returns ``EMSCRIPTEN_RESULT_SUCCESS`` when the event handler callback is removed and ``EMSCRIPTEN_RESULT_INVALID_PARAM`` otherwise.
0 commit comments