Modern Web Browser control – No Absolute Media Paths

Software Bug

Oh what a fun couple of hours I’ve had trying to revive a project I had started using the old Web Browser control and was trying to convert to use the Modern Web Browser control.

I did find, yet another, limitation when trying to dynamically populate the Modern Web Browser control!

It would seem that you cannot use absolute paths.


For instance, the following will work fine:

<img src="./images/picture.jpg" />

but this will not!:

<img src="C:/Temp/images/picture.jpg" />

and this even though it renders perfectly in Edge (or any other browser).

I tried all sorts of variations including prefixing with the file protocol, but it made no difference.

Once again, I suspect this is some security measure that cripples the Modern Web Browser control, again!

Some might ask why this is important, because this means it is impossible to dynamically generate content that uses local media! A pretty big deal for efficiently working with the Web Browser control. There are potential workarounds, but all will uselessly perform I/O operations for no reason.

I take it all back. I won’t bore you with the process, but the solution to using absolute paths is that they, as well, require the use of the ‘https:\\msaccess\’ prefix to work/load.

So the following will not work:

<img src="C:/Temp/images/picture.jpg" />

but, this will:

<img src="https://msaccess/C:/Temp/images/picture.jpg" />

I hope this helps some out you. Boy did I waste a lot of time on this!

However, even with this, certain files (JS amongst others) will still not load/work and you will receive errors. So basically, for very basic pages, dynamic loading is possible, but for any normal web content utilizing external local resources, it will fail miserably.

So it would seem the Modern Web Browser can’t even do what the old Web Browser control could.

The only workaround I can see is dynamically generating the HTML, saving it to disk, then loading the html file, but this is a whole lot of useless I/O operations for no reason.

Very disappointing Microsoft! Very disappointing indeed.

Further Digging Into The Matter

I couldn’t leave enough alone, and had to figure this out.

Eventually, I managed to crack the nut and it would seem that you cannot dynamically generate content when you first navigate to about:blank. If you try you will get CORS errors. So the only way to make this all work is to have a blank html file, load it initially, then you should be able to dynamically populate the control (with a few tricks to make it all work).

I’m working on a demo to come out in the near future which will hopefully put all this muttering of mine (sorry I know this post is a little off – been a long day banging my head against this stupidity for something that should have taken me 15-30 minutes max!) into context a little bit.

4 responses on “Modern Web Browser control – No Absolute Media Paths

  1. John F Clark

    This one had me chuckling to myself! Daniel, if no one has told you how good it is to have you back fighting the good fight, allow me to tell you now. Having smart folks like you and a few others (I would list them but this is YOUR site) out there getting dirty so hackers like me can (cleanly) benefit from your efforts is priceless and MUCH appreciated…

    1. Daniel Pineault Post author

      No issue naming other great Access contributors. For instance: Allen Browne, Mike Wolfe, Stephen Lebans, theDBguy, and many more.

      Then there are people like Dirk Goldgar, Duane Hookom, Douglas Steele that are to blame for teaching me my initial Access skills in the first place. It’s all their fault!!!

  2. Kent Roberts

    Retired from years of data-centric app development a few years ago. Came out of retirement to update a legacy Access 2003 app I created for my spouse’s company and just discovered your site. Truly impressive.

    FYI. I recently posted on AccessForums.net and Microsoft’s Feedback portal (Access) about inconsistent behavior I’m experiencing with the Edge Browser Control when navigating between local PDF files. I’ll paste a link into the Website entry to see if that works.