Commit Graph

53 Commits

Author SHA1 Message Date
Alex Maitland 17173587fe Core - Improve IBrowser.MainFrame and IBrowser.FocusedFrame null handling
- When CEF added CefFrameManager support the lifespan of a frame changed, it's now possible for MainFrame/FocusedFrame
  to be null when the browser is closed.

Issue #4368
2023-01-24 10:55:02 +10:00
Alex Maitland a51cdd3723 Core - OnSelectClientCertificate copy certificate vector
- Attempt to fix AccessViolationException by making a copy of
  the vector

Issue #2948
2023-01-17 10:22:59 +10:00
Alex Maitland c2edd111eb Core - Remove IRequestHandler.OnQuotaRequest
persistent quota is no longer supported (see https://crbug.com/1208141)

Resolves #4357
2023-01-08 11:53:54 +10:00
Alex Maitland 2e7dbef9ef Core - Update PdfPrintSettings
Resolves #4311
2022-11-21 15:10:19 +10:00
Alex Maitland 766ebbc8f6 Core - IFrame.IsMain remove ThrowIfFrameInvalid guard
- Calling IsMain on an invalid frame is allowable
2022-11-03 11:14:12 +10:00
Alex Maitland 416ed308c2 Core - Migrate from CefTime to CefBaseTime (Execution/Binding)
- Convert more of the methods used by JavaScript binding/execution
- Fix naming of FromDateTimeToBaseTime

Issue #4234
2022-09-06 19:39:43 +10:00
Alex Maitland 1a8c7cf09e Core - Migrate from CefTime to CefBaseTime (CefCookie)
- Add new method for conversion from DateTime to CefBaseTime
- Change Cookie.SetCreationDate and Cookie.SetLastAccessDate to take Long

Issue #4234
2022-09-06 15:03:36 +10:00
Alex Maitland 5f73ce568b Core - Migrate from CefTime to CefBaseTime (CefNavigationEntry)
- Add new method to convert from CefBaseTime to DateTime

Issue #4234
2022-09-06 14:21:11 +10:00
Alex Maitland 4d78c70793 Core - Migrate from CefTime to CefBaseTime (CefDownloadItem)
- Add new method to convert from CefBaseTime to nullable DateTime

Issue #4234
2022-09-06 14:11:45 +10:00
Alex Maitland b97dae0b61 Core - Merge DateTimeUtils into CefTimeUtils
Issue #4234
2022-09-06 13:50:25 +10:00
Alex Maitland a395b5d234 Core - Convert CefTime to CefBaseTime
- Interim step before replacing CefTime with CefBaseTime.

Issue #4234
2022-09-06 11:09:42 +10:00
Alex Maitland e064878d0a Core - CefValueWrapper add DebuggerDisplay 2022-08-19 11:07:05 +10:00
Alex Maitland 1ae9e01b41 Core - PermissionHandler followup
- Rename enums (remove cef prefix)
- Fix typos
- Slightly improve docs
2022-08-08 14:18:54 +10:00
Алексей f92687b7cc Core - Add support PermissonHandler
https://bitbucket.org/chromiumembedded/cef/issues/3352/add-cefpermissionhandler-callback-for-the
2022-08-08 13:59:32 +10:00
Alex Maitland 30f9d8db2c Core - CefRunContextMenuCallbackWrapper use cef_event_flags_t as typedef was removed
- Change to use cef_event_flags_t
- Fix some xml doc

https://github.com/chromiumembedded/cef/commit/d9b764860aa0c1dfad58b123474bc133c4e43d39
2022-08-02 13:33:52 +10:00
Alex Maitland f8530064b1 Core - Add Cef.PostAction and Cef.PostDelayedAction 2022-06-22 10:52:17 +10:00
Alex Maitland 15cb6d4754 Core - BrowserRefCount add some basic logging
Logs some basic information so we can see what type of ChromiumWebBrowser hasn't been closed
within as part of the xUnit tests.

* Meant for internal use and might be subject to change.
2022-05-31 15:43:34 +10:00
Alex Maitland 6c18e0e863 Update IDialogHandler.OnFileDialog method declaration
CEF is now using Chrome file dialogs on all platforms and runtimes, this brings a number of fixes and also some API changes.

- The selectedAcceptFilter filter arg has now been removed
- The CefFileDialogFlags enum has been removed as CEF no longer supports these options

This is a breaking change.

Issue #4110
2022-05-17 19:51:08 +10:00
Alex Maitland b4c4913b35 Core - Add IDownloadHandler.CanDownload
- Add IDownloadHandler.CanDownload
- Add to Fluent implementation
- Update examples

https://bitbucket.org/chromiumembedded/cef/commits/6d7a6801871cd4fcceb174dfa99a5b46da6253c1

Resolves #4090
2022-05-05 12:40:33 +10:00
Alex Maitland 0ac43cf69f Core - Remove Remaining Plugin APIs
- Remove plugin references
- Update xml doc comments
- Update ref assembly (netcore)
- Update examples

Issue #4045
2022-03-21 10:01:26 +10:00
Alex Maitland 597e54fc11 IBrowserHost.Find remove identifier param
Resolves #4013
2022-02-22 11:17:56 +10:00
Alex Maitland 8b247a6a37 Javascript Binding - IJavascriptCallbackProxy.ExecuteAsync correctly creates pending task using callback Id
- Previously a new PendingTask(TaskCompletionSource) was created using a new Id which worked when the Ids matched
  between the browser and render process. If you skipped executing a callback then the Ids would get out of sync.

Issue #3979
2022-01-27 16:03:22 +10:00
Alex Maitland a4a6fb20c7 Core - CefResourceRequestHandlerAdapter.GetCookieAccessFilter object reference not set to an instance of an object.
For resource requests that are handled by CefRequestContextHandlerAdapter::GetResourceRequestHandler
then _browserControl field will be null, added additional checks before calling TryGetBrowserCoreById

Follow up to https://github.com/cefsharp/CefSharp/commit/4ade0b8284d4f95f763c471a867139bff2bac2a9

Issue #3967
2022-01-18 11:04:12 +10:00
Alex Maitland 4ade0b8284 Core - ResourceRequestHandler now passes a long lived instance of IBrowser
- The methods in CefResourceRequestHandlerAdapter previously passed on a scoped instance of
  IBrowser which would have been disposed when the method was executed. This made it very
  difficult to use the callback in OnBeforeResourceLoad so now we check to see if we
  already have an IBrowser instance with the matching Id and only use a scoped instance
  if we don't have a match.
2022-01-10 13:44:30 +10:00
Alex Maitland 8160ec1ce4 Remove IRequestContextHandler.OnBeforePluginLoad and IRequestContext.PurgePluginListCache
Resolves #3924
2021-12-07 14:54:11 +10:00
Alex Maitland 9993aa78e0 OffScreen - Create Browser when Global CefRequestContext initialized.
- GlobalContextInitialized wraps a TaskCompletionSource which is resolved
  when the Global CefRequestContext has been created
- Reduce code duplication

If successful we can apply the same changes to WinForms/WPF though they're less likely to have
issues than the OffScreen implementation as the CreateBrowser doesn't happen until much later

Issue #3850 #3634
2021-10-26 14:31:10 +10:00
Alex Maitland 0e242a8706 Upgrade to CEF 95.7.10+g00d4ad5+chromium-95.0.4638.54 / Chromium 95.0.4638.54
Remove CefBrowserSettings.universal_access_from_file_urls and CefBrowserSettings.file_access_from_file_urls.
https://bitbucket.org/chromiumembedded/cef/commits/ff33d7f72144

Remove CefBrowserSettings.application_cache
https://bitbucket.org/chromiumembedded/cef/commits/370a7749e950ef6784c29a666d07a0b67148dd5f

Remove ignore_certificate_errors setting
https://bitbucket.org/chromiumembedded/cef/commits/aabe4ce466766f8bd9907e7fa30546a3afada214

RequestContextSettings.IgnoreCertificateErrors was removed, the CefSettings.IgnoreCertificateErrors property
now set the command line arg

Use CefRect for CefWindowInfo bounds
https://bitbucket.org/chromiumembedded/cef/commits/8587cc4e4bbc187aa989152e521318818b3f41d3

Additional overload has been added to pass in a Rect directly to SetAsChild

Rename SendFocusEvent to SetFocus
https://bitbucket.org/chromiumembedded/cef/commits/49a4611e28d7bbc221cff816d7c4a96c55ba2721

SendFocusEvent will now call SetFocus internally, the project internally has been updated to use SetFocus for WPF

Replace CefRequestCallback with CefCallback
https://bitbucket.org/chromiumembedded/cef/commits/3e7f1bb529442a6c7674262d9219df57964e9524

No changes to the API for this, I've kept the same interface and just mapped internally

Resolves #3857, #3667, #3668
2021-10-22 14:45:12 +10:00
Alex Maitland 7722881772 GetSource/GetText - Copy string rather than using ptr
New Mojo IPC implementation uses shared memory rather than a string copy
Attempt to workaround the access violation that's been reported in a few isolated cases
by copying the string rather than using directly.
https://github.com/chromiumembedded/cef/commit/ebee84755ed14e71388b343231d3a419f1c5c1fd
2021-10-04 15:01:54 +11:00
Alex Maitland db877d73ec Core - IFrameHandler.OnFrameAttached add reattached param
Resolves #3816
2021-09-20 11:51:10 +10:00
Alex Maitland 7f870db945 Core - FrameHandler track frame lifecycle
- FrameHandler now tracks frame creation and removal and reuses the IFrame reference
- CefFrameWrapper no longer throws exception if accessing Identifier for invalid frame, this appears
to be a valid use case now which makes sense otherwise we'd never be able to identify the frame.

Resolves #3588
2021-09-10 14:32:04 +10:00
Alex Maitland 4596d33f1e BrowserSubprocess - TreatWarningAsError for debug builds
Statically cast size_t to int to remove warnings
2021-09-10 10:08:40 +10:00
Alex Maitland 68dc297e68 Core - IStringVisitor.Visit check for empty string
Speculative fix for #3779
2021-09-05 15:41:15 +10:00
Alex Maitland 9567d14ab2 Core - FrameHandler update object lifespan (again)
- Only OnFrameCreated provides a heap managed IFrame reference
  this should be sufficient to keep track of frames using a
  Dictionary in FrameHandler
- Xml doc updates
- Reorder IFrameHandler methods

Issue #3588
2021-09-03 20:41:48 +10:00
Alex Maitland 7937f78b6f Core - OnFrameCreated/OnFrameAttached/OnFrameDetached allocate IFrame on managed heap
- Previously they were stack allocated and disposed when out of scope, they're now managed heap allocated
  to allow for users to keep a long lived reference.

FrameHandler still needs to be updated to deal with Disposing of the references.

Follow up to #3757

Issue #3588
2021-09-03 20:21:22 +10:00
campersau 8d98043000 Core - Add IFrameHandler (#3757)
* Core - Add IFrameHandler/FrameHandler
* Update comments
2021-09-03 20:13:42 +10:00
Alex Maitland d350cad52a Update to M93 (#3781)
* Upgrade to CEF 93.1.7+g9117d6a+chromium-93.0.4577.42 / Chromium 93.0.4577.42

- Core - Add basic ref counting implementation

IMPLEMENT_REFCOUNTING implementation uses atomic which
forces the VC++ compiler to compile as native which doesn't work for our managed ref classes.

    - Use InterlockedCompareExchange for custom ref count reads
    - Use InterlockedIncrement/InterlockedDecrement directly
    - There's no memory barrier for HasOneRef/HasAtLeastOneRef as the read of a LONG should happen in one operation
on 32/64 bit architectures (at least that's my understanding at this point in time).

    References:
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_x86_msvc.h#L125
    https://github.com/chromiumembedded/cef/blob/4472/include/base/internal/cef_atomicops_arm64_msvc.h#L107
    https://github.com/chromiumembedded/cef/blob/4472/include/base/cef_atomic_ref_count.h#L114
    https://github.com/chromiumembedded/cef/blob/4472/include/cef_base.h#L91

-  Remove Microsoft.Net.Compilers package from projects
Now that we require a min of VS2019 to build there's no need for a custom compiler package
- Start removing VS2015/VC++2015 references
- Remove RegisterWidevineCdm
This is a breaking change. CEF will now automatically download the Widevine CDM component
Resolves #3767

- RequestContext.LoadExtension now uses managed to code spawn on CEF UI Thread
Avoid having to use cef_callback.h which was causing problems for x86 builds
2021-09-03 10:51:18 +10:00
campersau 898b843d5d DevTools - Add GetNextDevToolsMessageId to IBrowserHost (#3774) 2021-08-28 11:44:12 +10:00
Alex Maitland e7c4c726ed Core - Remove Cookie.Creation/LastAccessed setters
Resolves #3741
2021-08-25 10:48:58 +10:00
Alex Maitland e00b1ce0bf WPF - SendKeyEvent use VK_MENU instead of VK_RMENU || VK_LMENU
Follow up to https://github.com/cefsharp/CefSharp/pull/3769
2021-08-25 09:35:57 +10:00
spinalcord b86aa00c41 WPF - Support ALT(Left) and ALT GR (Right) Key (#3769)
Allows also to use the left ALT key, which necessary to input symbols e.g. german keyboard layout.
2021-08-25 09:28:08 +10:00
Alex Maitland a18637facd C++/CLI - Replace NULL with nullptr
Issue #3636
2021-07-31 15:52:56 +10:00
Alex Maitland b24cd8e2d7 C++/CLI - Replace OVERRIDE with override
OVERRIDE was a CEF macro which has been removed, use standard compliant override

Issue #3636
2021-07-31 15:52:55 +10:00
campersau b83bebb042 WPF - Simplify Support Shift + AltGr (#3701) 2021-07-24 15:46:44 +10:00
Alex Maitland 0a1a8855c5 Core - Add IBrowser.IsValid
- Add IBrowser.IsValid
- Update xml doc comments
- Remove ExecuteScriptAsync CanExecuteJavascriptInMainFrame check as CEF should now internally queue commands for ExecuteScript and LoadRequest

https://bitbucket.org/chromiumembedded/cef/issues/2421/add-onframecreated-onframedeleted#comment-60616371

Issue #3588
2021-07-22 13:27:36 +10:00
ptrsky 136b928c0e WPF - Add support for Shift+AltGr (#3627)
* WPF - Add support for Shift+AltGr

The handling of AltGr characters in CefBrowsterHostWrapper did not cover capital diacritic letters. This commit adds handling for the Shift + AltGr + character combination.

* WPF - Shift+AltGr review fixes

* Trigger rebuild
2021-06-21 15:15:58 +10:00
Alex Maitland d5702be495 Core - ClientAdapter::OnProcessMessageReceived add nullptr checks
Follow up to https://github.com/cefsharp/CefSharp/discussions/3573
2021-05-20 10:07:53 +10:00
Alex Maitland 1850f3e0af Core - IJavascriptCallback need additional null check in ClientAdapter::GetBrowserWrapper
IJavascriptCallbacks that are finalized after the browser has been Disposed
but before the IBrowserAdapter.IsDisposed is set might end up calling ClientAdapter::GetBrowserWrapper
which attempts to access _popupBrowsers which has been set to null already.
2021-05-10 15:34:11 +10:00
Alex Maitland 52374b74a7 Core - Remove IContextMenuParams.IsPepperMenu
This is a breaking change

Resolves #3460
2021-03-27 11:17:23 +10:00
Alex Maitland 6601a66b75 Javascript Binding - ClientAdapter.MethodInvocationComplete NRE
Resolves #3443
2021-03-12 11:59:04 +10:00
Alex Maitland 12e583d2ef Core - PublicApi remove references to CefSharp.Core.Runtime
- Add an UnWrap method to the interfaces (should be hidden from IntelliSense)
- For .Net 4.5.2 projects they're  not a decorator class which an inner instance of the CefSharp.Core.Runtime Type
- For Net Core we have a ref assembly which allows us to reference the CefSharp.Core.Runtime without issues
  We can potentially remove the ref assembly now and forgo any direct reference.
2021-01-13 16:56:57 +10:00