Opened 9 years ago

Closed 8 years ago

#14623 closed enhancement (fixed)

A wxWebView virtual file system handler class to support wxMemoryFSHandler

Reported by: nickmat Owned by:
Priority: normal Milestone:
Component: WebView Version: stable-latest
Keywords: wxFileSystem wxMemoryFSHandler wxWebView Cc:
Blocked By: Blocking:
Patch: yes

Description

I've been looking at updating my app to use wxWebView in place of wxHtml. The app makes significant use of wxMemoryFSHandler but the documentation is a bit sparse so I hope this is a suitable solution.

I've added a very simple wxWebView file scheme handler class, wxWebViewFSHandler to make it easier to use wxWidget's virtual file system.

I've updated the documentation and in particular, amended the example given with the wxMemoryFSHandler class to show how it can be used with both the wxHtml and wxWebView systems.

The patch also adds a menu option to the WebView sample which demonstrates how the new class is used.

Attachments (1)

webviewfs.patch download (14.3 KB) - added by nickmat 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by nickmat

comment:1 Changed 8 years ago by steve_lamerton

  • Keywords wxWebView added
  • Status changed from new to confirmed

comment:2 Changed 8 years ago by steve_lamerton

  • Status changed from confirmed to infoneeded_new

Thank you very much for this patch! I have tested it on MSW and it works great. Just a couple of questions before I apply the patch. Firstly how would you like to be credited in the changelog? Also have you done any testing with file systems other than the memory handler? When I originally wrote the wxWebViewArchiveHandler it was because the existing wxFileSystem syntax for archive didn't work very well.

comment:3 Changed 8 years ago by nickmat

  • Status changed from infoneeded_new to new

I did consider other protocols, but after looking at the "wxFileSystem Overview" I guessed that the way wxFileSystem implemented combined protocols would confuse the browser engines, which is why a different approach is needed for these. But I don't see why it shouldn't work for any single-protocol handler. Of the 4 built-in file system handlers: 2 are combined-protocols and the wxInternetFSHandler is a bit redundant here - leaving only the wxMemoryFSHandler.

Maybe this should be documented, but since it was mostly guesswork, I just left it open.

I did briefly look at converting the html/virtual sample, but it documents a hack which is acceptable for wxHtml but probably not for wxWebView, so I didn't pursue it.

One test I did do, which I didn't include in the sample, was to test the # anchor part. This worked as expected.

Nick Matthews, happy to take the blame.

comment:4 Changed 8 years ago by SJL

  • Resolution set to fixed
  • Status changed from new to closed

(In [72461]) Add generic wxFileSystem support to wxWebView using wxWebViewFSHandler.

Closes #14623.

Note: See TracTickets for help on using tickets.