Skip to content

Commit

Permalink
Upgrade to electron v32.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Oct 5, 2024
1 parent 5fe4e27 commit e533a05
Show file tree
Hide file tree
Showing 10 changed files with 353 additions and 312 deletions.
14 changes: 7 additions & 7 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"start": "electron ."
},
"devDependencies": {
"electron": "v32.0.2"
"electron": "v32.1.2"
}
}
615 changes: 316 additions & 299 deletions electron-api.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion haxelib.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"description": "Type definitions for the electron framework",
"releasenote": "See CHANGELOG",
"version": "32.0.2",
"version": "32.1.2",
"contributors": [
"tong",
"fponticelli"
Expand Down
6 changes: 5 additions & 1 deletion src/electron/main/DesktopCapturer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ package electron.main;
// Grant access to the first screen found.
callback({ video: sources[0], audio: 'loopback' })
})
})
// If true, use the system picker if available.
// Note: this is currently experimental. If the system picker
// is available, it will be used and the media request handler
// will not be invoked.
}, { useSystemPicker: true })
mainWindow.loadFile('index.html')
})
Expand Down
7 changes: 6 additions & 1 deletion src/electron/main/Session.hx
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,16 @@ package electron.main;
/**
This handler will be called when web content requests access to display media via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer API to choose which stream(s) to grant access to.
`useSystemPicker` allows an application to use the system picker instead of providing a specific video source from `getSources`. This option is experimental, and currently available for MacOS 15+ only. If the system picker is available and `useSystemPicker` is set to `true`, the handler will not be invoked.
Passing a WebFrameMain object as a video or audio stream will capture the video or audio stream from that frame.
Passing `null` instead of a function resets the handler to its default state.
**/
function setDisplayMediaRequestHandler(handler:haxe.extern.EitherType<haxe.Constraints.Function, Dynamic>):Void;
function setDisplayMediaRequestHandler(handler:haxe.extern.EitherType<haxe.Constraints.Function, Dynamic>, ?opts:{ /**
true if the available native system picker should be used. Default is `false`. _macOS_ _Experimental_
**/
var useSystemPicker : Bool; }):Void;
/**
Sets the handler which can be used to respond to device permission checks for the `session`. Returning `true` will allow the device to be permitted and `false` will reject it. To clear the handler, call `setDevicePermissionHandler(null)`. This handler can be used to provide default permissioning to devices without first calling for permission to devices (eg via `navigator.hid.requestDevice`). If this handler is not defined, the default device permissions as granted through device selection (eg via `navigator.hid.requestDevice`) will be used. Additionally, the default behavior of Electron is to store granted device permission in memory. If longer term storage is needed, a developer can store granted device permissions (eg when handling the `select-hid-device` event) and then read from that storage with `setDevicePermissionHandler`.
**/
Expand Down
3 changes: 3 additions & 0 deletions src/electron/main/View.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ package electron.main;
If the same View is added to a parent which already contains it, it will be reordered such that it becomes the topmost view.
**/
function addChildView(view:electron.main.View, ?index:Int):Void;
/**
If the view passed as a parameter is not a child of this view, this method is a no-op.
**/
function removeChildView(view:electron.main.View):Void;
function setBounds(bounds:electron.Rectangle):Void;
/**
Expand Down
6 changes: 5 additions & 1 deletion src/electron/remote/DesktopCapturer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ package electron.remote;
// Grant access to the first screen found.
callback({ video: sources[0], audio: 'loopback' })
})
})
// If true, use the system picker if available.
// Note: this is currently experimental. If the system picker
// is available, it will be used and the media request handler
// will not be invoked.
}, { useSystemPicker: true })
mainWindow.loadFile('index.html')
})
Expand Down
7 changes: 6 additions & 1 deletion src/electron/remote/Session.hx
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,16 @@ package electron.remote;
/**
This handler will be called when web content requests access to display media via the `navigator.mediaDevices.getDisplayMedia` API. Use the desktopCapturer API to choose which stream(s) to grant access to.
`useSystemPicker` allows an application to use the system picker instead of providing a specific video source from `getSources`. This option is experimental, and currently available for MacOS 15+ only. If the system picker is available and `useSystemPicker` is set to `true`, the handler will not be invoked.
Passing a WebFrameMain object as a video or audio stream will capture the video or audio stream from that frame.
Passing `null` instead of a function resets the handler to its default state.
**/
function setDisplayMediaRequestHandler(handler:haxe.extern.EitherType<haxe.Constraints.Function, Dynamic>):Void;
function setDisplayMediaRequestHandler(handler:haxe.extern.EitherType<haxe.Constraints.Function, Dynamic>, ?opts:{ /**
true if the available native system picker should be used. Default is `false`. _macOS_ _Experimental_
**/
var useSystemPicker : Bool; }):Void;
/**
Sets the handler which can be used to respond to device permission checks for the `session`. Returning `true` will allow the device to be permitted and `false` will reject it. To clear the handler, call `setDevicePermissionHandler(null)`. This handler can be used to provide default permissioning to devices without first calling for permission to devices (eg via `navigator.hid.requestDevice`). If this handler is not defined, the default device permissions as granted through device selection (eg via `navigator.hid.requestDevice`) will be used. Additionally, the default behavior of Electron is to store granted device permission in memory. If longer term storage is needed, a developer can store granted device permissions (eg when handling the `select-hid-device` event) and then read from that storage with `setDevicePermissionHandler`.
**/
Expand Down
3 changes: 3 additions & 0 deletions src/electron/remote/View.hx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ package electron.remote;
If the same View is added to a parent which already contains it, it will be reordered such that it becomes the topmost view.
**/
function addChildView(view:electron.remote.View, ?index:Int):Void;
/**
If the view passed as a parameter is not a child of this view, this method is a no-op.
**/
function removeChildView(view:electron.remote.View):Void;
function setBounds(bounds:electron.Rectangle):Void;
/**
Expand Down

0 comments on commit e533a05

Please sign in to comment.