* feat: add blinkUtils module with getPathForFile method
This is designed to replace the File.path augmentation
we currently have in place to allow apps to get the filesystem
path for a file that blink has a representation of.
File.path is non-standard and messes with certain websites, using
a method like this is effectively 0-cost and removes one of the final
deviations we have with web standards.
* add error
* refactor: update per PR feedback
* chore: update patches
* oops
* chore: update patches
* chore: update patches
* feat: add blinkUtils module with getPathForFile method
This is designed to replace the File.path augmentation
we currently have in place to allow apps to get the filesystem
path for a file that blink has a representation of.
File.path is non-standard and messes with certain websites, using
a method like this is effectively 0-cost and removes one of the final
deviations we have with web standards.
* add error
* refactor: update per PR feedback
* chore: update patches
* oops
* chore: update patches
* chore: update patches
* chore: update patches
* fix: provide isolate to WebBlob::FromV8Value
* chore: add tests
* build: fix depshash mismatch on arm64 macOS
---------
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
* feat: make desktopCapturer main-process-only
* remove --enable-api-filtering-logging
* remove test
* merge lib/browser/api/desktop-capturer.ts with lib/browser/desktop-capturer.ts
* remove desktop-capturer-get-sources event
* fix specs
* getSources needs to be async
Co-authored-by: Milan Burda <milan.burda@gmail.com>
* refactor: clean up webFrame implementation to use gin wrappers
The previous implementation of webFrame in the renderer process leaked
sub-frame contexts and global objects across the context boundaries thus
making it possible for apps to either maliciously or accidentally
violate the contextIsolation boundary.
This re-implementation binds all methods in native code directly to
content::RenderFrame instances instead of relying on JS to provide a
"window" with every method request. This is much more consistent with
the rest of the Electron codebase and is substantially safer.
* chore: un-re-order for ease of review
* chore: pass isolate around instead of ErrorThrower
* chore: fix rebase typo
* chore: remove unused variables
* initial commit, mac implementation
* add documentation
* convert createThumbnailFromPath to async function
* windows impl protoype
* add tests
* added test
* fix
* fix test
* clean up
* update docs
* cleaning up code
* fix test
* retrigger CI
* retrigger CI
* refactor from app to native_image
* windows build
* lint
* lint
* add smart pointers, fix test
* change tests and update docs
* fix test, remove nolint
* add renderer-main process routing to fix tests
* lint
* thanks sam
* thanks sam
* feat: add a new contextBridge module
* chore: fix docs linting
* feat: add support for function arguments being proxied
* chore: ensure that contextBridge can only be used when contextIsolation is enabled
* docs: getReverseBinding can be null
* docs: fix broken links in md file
* feat: add support for promises in function parameters
* fix: linting failure for explicit constructor
* Update atom_api_context_bridge.cc
* chore: update docs and API design as per feedback
* refactor: remove reverse bindings and handle GC'able functions across the bridge
* chore: only expose debugGC in testing builds
* fix: do not proxy promises as objects
* spec: add complete spec coverage for contextBridge
* spec: add tests for null/undefined and the anti-overwrite logic
* chore: fix linting
* spec: add complex nested back-and-forth function calling
* fix: expose contextBridge in sandboxed renderers
* refactor: improve security of default_app using the new contextBridge module
* s/bindAPIInMainWorld/exposeInMainWorld
* chore: sorry for this commit, its a big one, I fixed like everything and refactored a lot
* chore: remove PassedValueCache as it is unused now
Values transferred from context A to context B are now cachde in the RenderFramePersistenceStore
* chore: move to anonymous namespace
* refactor: remove PassValueToOtherContextWithCache
* chore: remove commented unused code blocks
* chore: remove .only
* chore: remote commented code
* refactor: extract RenderFramePersistenceStore
* spec: ensure it works with numbered keys
* fix: handle number keys correctly
* fix: sort out the linter
* spec: update default_app asar spec for removed file
* refactor: change signatures to return v8 objects directly rather than the mate dictionary handle
* refactor: use the v8 serializer to support cloneable buffers and other object types
* chore: fix linting
* fix: handle hash collisions with a linked list in the map
* fix: enforce a recursion limit on the context bridge
* chore: fix linting
* chore: remove TODO
* chore: adapt for PR feedback
* chore: remove .only
* chore: clean up docs and clean up the proxy map when objects are released
* chore: ensure we cache object values that are cloned through the V8 serializer