Commit graph

56 commits

Author SHA1 Message Date
Rhitik Bhatt
4cb57ad1a0
docs: removes unused import in preload script (#35324)
* Remove unused import of path

This import gives out the error in the preload script:

Error: module not found: path
    at preloadRequire

* Removes unused import in preload script

notes: Removes unused import which causes issue in preload script of drag and drop tutorial

* Remove import path as it is not used in the script

note: Removes import path as it is not used in the script
2022-08-15 15:23:59 +09:00
Erick Zhao
e410109a3d
docs: expand tutorial (#34604)
* docs: base tutorial update

* more docs

* zzz

* remove unused images
2022-06-22 17:17:48 +09:00
John Kleinschmidt
4f8a843606
docs: clarify added/removed events on device APIs (#34177) 2022-05-11 13:01:56 -07:00
Abhay Gupta
b274011720
fix: fiddle ipc code pattern 3 (#33262) 2022-03-16 11:01:29 -04:00
Chuion
0ff1727ec0
docs: fix missing dependencies in ipc patterns (#33082) 2022-03-07 17:04:58 -05:00
Ruslan
067cc8ae2b
Update main.js (#33039) 2022-02-24 12:59:29 -08:00
Erick Zhao
e9a43be9be
docs: add IPC doc (#32059)
* docs: add IPC doc

* fix: use "string" primitive

* use 'string' ipcrenderer

* use "number" primitive

* Update docs/tutorial/ipc.md

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* Update docs/tutorial/ipc.md

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>

* add code sample

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
2022-02-09 11:00:05 -05:00
Erick Zhao
c3a8ad254a
docs: add window customization guide (#31054)
* docs: add window customization guide

* fixes

* Update docs/api/browser-window.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/api/browser-window.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/fiddles/windows/manage-windows/frameless-window/index.html

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* Update docs/tutorial/window-customization.md

Co-authored-by: Mark Lee <malept@users.noreply.github.com>

* fix code fence

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
2021-10-19 09:58:35 +09:00
Ryan Johnson
6db8d7918d
fix: dialog is not defined (#31180)
Corrects the following error in Electron Fiddle:

```
Uncaught Exception:
ReferenceError: dialog is not defined
...
```
2021-10-04 10:12:55 +09:00
John Kleinschmidt
6aece4a83d
feat: add support for WebHID (#30213)
* feat: add support for WebHID

* Apply suggestions from code review

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* Address review feedback

* Address review feedback

* chore: clear granted_devices on navigation

Also added test to verify devices get cleared

* fixup testing for device clear

* make sure navigator.hid.getDevices is run on correct frame

* clear granted devices on RenderFrameHost deletion/change

* manage device permissions per RenderFrameHost

This change makes sure we don't clear device permission prematurely due to child frame navigation

* Update shell/browser/api/electron_api_web_contents.cc

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

* apply review feedback from @zcbenz

* Match upstream ObjectMap

This change matches what ObjectPermissionContextBase uses to cache object permissions: https://source.chromium.org/chromium/chromium/src/+/main:components/permissions/object_permission_context_base.h;l=52;drc=8f95b5eab2797a3e26bba299f3b0df85bfc98bf5;bpv=1;bpt=0

The main reason for this was to resolve this crash on Win x64:
ok 2 WebContentsView doesn't crash when GCed during allocation
Received fatal exception EXCEPTION_ACCESS_VIOLATION
Backtrace:
        gin::WrappableBase::SecondWeakCallback [0x00007FF6F2AFA005+133] (o:\gin\wrappable.cc:53)
        v8::internal::GlobalHandles::InvokeSecondPassPhantomCallbacks [0x00007FF6F028F9AB+171] (o:\v8\src\handles\global-handles.cc:1400)
        v8::internal::GlobalHandles::InvokeSecondPassPhantomCallbacksFromTask [0x00007FF6F028F867+391] (o:\v8\src\handles\global-handles.cc:1387)
        node::PerIsolatePlatformData::RunForegroundTask [0x00007FF6F3B4D065+317] (o:\third_party\electron_node\src\node_platform.cc:415)
        node::PerIsolatePlatformData::FlushForegroundTasksInternal [0x00007FF6F3B4C424+776] (o:\third_party\electron_node\src\node_platform.cc:479)
        uv_run [0x00007FF6F2DDD07C+492] (o:\third_party\electron_node\deps\uv\src\win\core.c:609)
        electron::NodeBindings::UvRunOnce [0x00007FF6EEE1E036+294] (o:\electron\shell\common\node_bindings.cc:631)
        base::TaskAnnotator::RunTask [0x00007FF6F2318A19+457] (o:\base\task\common\task_annotator.cc:178)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl [0x00007FF6F2E6F553+963] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:361)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork [0x00007FF6F2E6EC69+137] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:266)
        base::MessagePumpForUI::DoRunLoop [0x00007FF6F235AA58+216] (o:\base\message_loop\message_pump_win.cc:221)
        base::MessagePumpWin::Run [0x00007FF6F235A01A+106] (o:\base\message_loop\message_pump_win.cc:79)
        base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run [0x00007FF6F2E702DA+682] (o:\base\task\sequence_manager\thread_controller_with_message_pump_impl.cc:470)
        base::RunLoop::Run [0x00007FF6F22F95BA+842] (o:\base\run_loop.cc:136)
        content::BrowserMainLoop::RunMainMessageLoop [0x00007FF6F14423CC+208] (o:\content\browser\browser_main_loop.cc:990)
        content::BrowserMainRunnerImpl::Run [0x00007FF6F144402F+143] (o:\content\browser\browser_main_runner_impl.cc:153)
        content::BrowserMain [0x00007FF6F143F911+257] (o:\content\browser\browser_main.cc:49)
        content::RunBrowserProcessMain [0x00007FF6EFFA7D18+112] (o:\content\app\content_main_runner_impl.cc:608)
        content::ContentMainRunnerImpl::RunBrowser [0x00007FF6EFFA8CF4+1220] (o:\content\app\content_main_runner_impl.cc:1104)
        content::ContentMainRunnerImpl::Run [0x00007FF6EFFA87C9+393] (o:\content\app\content_main_runner_impl.cc:971)
        content::RunContentProcess [0x00007FF6EFFA73BD+733] (o:\content\app\content_main.cc:394)
        content::ContentMain [0x00007FF6EFFA79E1+54] (o:\content\app\content_main.cc:422)
        wWinMain [0x00007FF6EECA1535+889] (o:\electron\shell\app\electron_main.cc:291)
        __scrt_common_main_seh [0x00007FF6F6F88482+262] (d:\A01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
        BaseThreadInitThunk [0x00007FFEC0087034+20]
        RtlUserThreadStart [0x00007FFEC1F02651+33]
✗ Electron tests failed with code 0xc0000005.

Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2021-09-23 20:00:11 +09:00
George Xu
b7164428ec
docs: modernize protocol-handler docs (#29380)
* docs: modernize protocol-handler docs

* docs: iadd contextIsolation

* docs: add guide for launch-app-from-URL-in-other-app

* docs: address comments

* chore: fix brackets

* chore: add escaped brackets
2021-07-08 11:42:28 -07:00
George Xu
f022ead559
docs: added guide and updated docs for Tray (#29385)
* docs: added guide and updated docs for Tray

* docs: improve clarity
2021-06-15 10:34:53 +09:00
Kevin Hartman
3e2ec0e2ce
docs: Update represented-file fiddle tutorial (#29245)
* Update represented-file fiddle.

* add index and code back to guide

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-15 10:29:51 +09:00
ZReC
330b7849a3
docs: fix typo (#29553)
* Typo fix

* Update main.js
2021-06-08 11:45:45 +09:00
Jeremy Foster
fc10b53f95
docs: Update notifications (renderer) docs (#29267)
* remove version information from html

* change format for readability

* clarify which console the message should appear in

* minor changes to renderer.md

* update UI on click instead of developer console

* remove node-integration and fix md

* update content

* chore: remove ****

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-06-07 13:02:20 +09:00
Kevin Hartman
dd98fa3cd3
docs: Updated "recent documents" fiddle tutorial (#29242)
* Port recent-documents fiddle to 12-x-y.

* Update recent-documents tutorial.

* update for review comments

Co-authored-by: Ethan Arrowood <ethan.arrowood@gmail.com>
2021-06-07 10:43:24 +09:00
Jeremy Foster
dee4c4b908
docs: Updated "progress bar" fiddle feature in docs (#29237)
* improve progress bar fiddle

* add comments to code snippet

* edits to progress-bar tutorial

* remove versions and nodeIntegration

* limit line length to 100

* implement standard linter suggestions

* add indeterminate and clear timers

* update to have reader replace all of main.js

* remove extra button

* loop the progress bar

* add logic to show reset state briefly

* Update docs/tutorial/progress-bar.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* chore: fix lint

Co-authored-by: Cheng Zhao <github@zcbenz.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-06-02 11:41:13 +09:00
Jeremy Foster
5e033cb7f8
docs: Update notifications (main) docs (#29268)
* remove version info from index.html page

* remove nodeIntegration

* format code and update readme

* add note to user in index.html
2021-05-27 10:18:50 +09:00
Ethan Arrowood
12aa6d7343
docs: Update online detection doc and fiddle (#29212)
* rework online detection doc and fiddle

* add footnote

* Update docs/tutorial/online-offline-events.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Update docs/tutorial/online-offline-events.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Update docs/tutorial/online-offline-events.md

* Update docs/tutorial/online-offline-events.md

* Update docs/tutorial/online-offline-events.md

* chore: fix lint error

Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
2021-05-24 16:34:00 +09:00
Kevin Hartman
7209702278
Use path.join when logging screenshot path. (#29211)
Remove index.html from offscreen-rendering tutorial.
It is not used.

Update offscreen-rendering.md to reflect changes to fiddle.
2021-05-24 11:33:45 +09:00
Tony Ferrell
77e7d828ee
docs: Update docs for keyboard shortcuts (#29207)
* Update docs for keyboard shortcuts

* Add a fiddle for web-apis

* Apply suggestions from code review

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* Cleanup a few formatting errors and missed copies

* Add descriptions to index.html

* Focus on renderer

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-24 11:33:22 +09:00
Tony Ferrell
071fa2ab8f
docs: update the macos Dock Instructions (#29197)
* Update the macos Dock Instructions

* Remove preload and ;'s

* Mixed ;s

* Update dock doc

* Add informational text to index.html
2021-05-19 10:03:13 +09:00
Ethan Arrowood
5656493676
docs: update macos-dark-mode fiddle and guide content (#29198)
* update macos dark mode docs for Electron v12

* pr review fixes

* more pr review fixes

* reorg paragraphs for better flow

* Update docs/tutorial/dark-mode.md

Co-authored-by: Erick Zhao <erick@hotmail.ca>

* pr fixes

Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-19 10:02:12 +09:00
Tony Ferrell
adb85f341b
docs: update drag and drop tutorial (#29200)
* Working

* Working

* Make the native-file drag and drop documents use context bridge

* Add per-file sections

* Use the updated link format

* Use path.join instead of string interpolation.

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Use fs.promises

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Update docs/tutorial/native-file-drag-drop.md

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* fix formatting

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Update docs/tutorial/native-file-drag-drop.md

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>

* Use more path.join instead of interpolation

* Update with PR suggestions

* Remove process.cwd() and add more example elements

* Minor text fix

* Fix typo

Co-authored-by: Erick Zhao <erick@hotmail.ca>

Co-authored-by: Antón Molleda <molant@users.noreply.github.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
2021-05-19 09:55:24 +09:00
Will Anderson
b6ff12ef7f
docs: update Quick Start Guide for Electron 12 (#28223)
* docs: Update Quick Start Guide for Electron 12

With `contextIsolation` enabled by default in Electron 12, the Getting Started Guide no longer works as it is written. In order for the basic example to display values from `process.versions`, we need to add a `preload.js` to the example.

* fix: annotate preload code block with a language

* docs: update quick-start Fiddle example to use preload to provide version info

* fix: ensure example files end in a newline

* docs: add security warning to instructions for turning off contextIsolation

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

* docs: treat preload as an adjective instead of a noun

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>

Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2021-03-16 19:45:38 -04:00
Jeremy Rose
2e091d401e
docs: update fiddles/quick-start to set contextIsolation: false (#27970) 2021-03-03 16:18:07 -08:00
Antonio
fadd513739
docs: added fiddle support for code samples (#26501)
* docs: added fiddle support for code samples in quick start guide and features

* docs: removed excessive fiddle links for not final steps

* docs: added eof newlines to fiddle examples

* docs: reworked fiddle examples to be more self-sufficient

* docs: reworked fiddle examples according to mentions

* docs: changed http to https in the offscreen rendering fiddle

* docs: fix recent documents fiddle to be more consistent
2020-11-30 16:48:39 +09:00
Jeremy Rose
5de7eb3618
docs: remove references to remote from docs (#25416) 2020-09-14 10:36:54 -07:00
Electron Bot
443540fd13 Bump v12.0.0-nightly.20200827 2020-08-27 07:31:51 -07:00
Charles Kerr
33ef0d23a6
docs: minor grammar & spelling fixes (#22851)
* docs: fix minor grammar error 'punctuations'

* docs: fix minor grammar error pluralizing Chromium

* docs: fix typo 'updateCurrentActiviy'

* docs: use consistent spelling of 'behavior'

* docs: use 'macOS' instead of 'Mac OS' or 'OS X'.

* docs: use 'GTK' instead of 'GTK+'

https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html

* docs: minor capitalization: use 'TCP' not 'tcp'

* Update docs/development/build-instructions-linux.md

Co-Authored-By: Mark Lee <malept@users.noreply.github.com>

Co-authored-by: Mark Lee <malept@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
2020-03-31 13:06:25 +09:00
Jeremy Apthorp
f8c4be7caa
docs: replace electron.atom.io with electronjs.org in docs/fiddles (#22196) 2020-02-17 09:46:41 +09:00
Charles Kerr
c83f836faf
refactor: prefer using app.whenReady() (#21972)
* docs: add references to app.whenReady() in isReady

* refactor: prefer app.whenReady()

In the docs, specs, and lib, replace instances of `app.once('ready')`
(seen occasionally) and `app.on('ready')` (extremely common) with
`app.whenReady()`.

It's better to encourage users to use whenReady():
1. it handles the edge case of registering for 'ready' after it's fired
2. it avoids the minor wart of leaving an active listener alive for
an event that wll never fire again
2020-02-03 22:43:22 +00:00
Konstantinos Ntoutsos-Oikonomou
20c910f98e docs: New fiddle example 'Create a new window' (#20480)
* add: New fiddle for Manage Windows section example

* Delete package.json

Not needed

* Address issue with .gitignore file, load new window, removing unwanted css class

* Delete package.json

* Pushing change regarding the use of shell.OpenExternal API with an event listener for the href tag on the link
2020-01-13 15:35:56 +09:00
Yaser
b31084493e docs: Added Window Management Fiddle example (#20535) 2020-01-13 15:34:13 +09:00
Yaser
143407ea1b docs: Adds Native-UI tray Fiddle example (#20526) 2019-12-04 15:38:53 +09:00
Yaser
1b61fe780e docs: adds Native-UI Open external links and the file manager Fiddle example (#20524) 2019-12-04 15:38:19 +09:00
Kristof Kalocsai
821bcdef75 docs: added windows -> create frameless window example (#20591)
* docs: added windows -> create frameless window example from electron-api-docs

* fixed style in accord with StandardJS

* removed class tag from button
2019-11-13 14:49:13 +09:00
Alan Ionita
a15e0e0657 FEAT [#20442] : adds the fiddle for launching an app from URL in another app, including all 3 files main.js, index.html, renderer.js (#20718) 2019-11-13 14:46:54 +09:00
Alan Ionita
09533e77da feat: #20442 adds fiddle for opening external links and the pro version of opening all outbound links (#20763) 2019-11-13 14:46:35 +09:00
Yaser
e5ba6c5406 docs: Adds Desktop notifications Fiddle example (#20525)
* docs: Adds Desktop notifications Fiddle example

* Update index.html

Removed the classes
2019-11-06 09:24:41 -08:00
CezaryKulakowski
00a1cd9395 fix: changed crlf to lf in some docs files (#20832) 2019-11-05 13:39:39 -08:00
Amarnath Karthi
0fe718b1d9 docs: add Synchronous Messages Fiddle example (#20451)
* docs: add Synchronous Messages Fiddle example

* Code review changes

* Add OS support info
2019-11-01 14:02:42 -04:00
Amarnath Karthi
06285f0bf1 docs: add app information example (#20487)
* docs: add app information example

* Code review changes

* Remove demo-control css class, link href change
2019-11-01 08:04:47 -07:00
Yaser
b060cbf4ec docs: Adds Dialogs Fiddle example (#20473) 2019-10-31 11:04:24 -07:00
Kristof Kalocsai
7b28cd33cb docs: Added Native User Interface -> Open path in file manager Fiddle example (#20589)
* docs: Added Native User Interface -> Open path in file manager Fiddle example from electron-api-demos

* removed classname from button
2019-10-21 16:16:11 +09:00
Yaser
4e88633d89 docs: Added Drag and drop files Fiddle example (#20472) 2019-10-21 16:14:35 +09:00
Harendra Singh
db91673f23 docs: add example for taking screenshot (#20531) 2019-10-16 08:17:50 -07:00
Vlad Hashimoto
c73e34fb9e docs: remove class names from fiddle examples (#20596)
* docs: remove original class names in customize menus example

* docs: remove original class names in shortcuts example

* lint: run standard
2019-10-16 08:17:09 -07:00
Harendra Singh
93788e76e0 docs: add notification examples (#20528)
Refs #20442

Adds the basic notification and notification with custom image examples from electron-api-demos into runnable Fiddle examples.

Gist links to Fiddles (same as code submitted in this PR):
Basic Notification: https://gist.github.com/102945f83f559e7944797175d8fd8af4
Notification with image: https://gist.github.com/2688bf4bfc27ce02f5d74224828eb928

Co-Authored-By: Erick Zhao <erick@hotmail.ca>
2019-10-15 14:06:58 -07:00
Rik Theunis
16d4ace800 docs: add system get version info Fiddle example (#20536) 2019-10-15 11:17:04 -07:00