Change in how FM Server 21.1 uses web viewers within WebDirect

Hiya - I've been working on a project that is accessed via WebDirect and uses a web viewer to display Javascript-generated charts and tables. Before 21.1, I needed to encode the html into Base64, and then use ""data:text/html;base64" in the web viewer to decode the encoded html.

Interestingly I could never get this to work in iPadOS or iOS when using Base64Encoding, and it of course would take extra processor cycles on the desktop, so I've used variations of the following code:

If ( PatternCount ( Lower ( Get ( ApplicationVersion ) ) ; "web" ) ;

// then

"data:text/html;base64," & 

Base64Encode ( Substitute ( DEV_Libraries_html_Selected::Code ; 

	[ "~CSS" ; DEV_Libraries_css_Selected::Code ] ; 

	[ "~CODE" ; Evaluate ( DEV_WebObjects_Selected::FMCode ) ] ) ) ;

// else

"data:text/html," & 

Substitute ( DEV_Libraries_html_Selected::Code ; 

	[ "~CSS" ; DEV_Libraries_css_Selected::Code ] ; 

	[ "~CODE" ; Evaluate ( DEV_WebObjects_Selected::FMCode ) ] ) )

++++

The good news is that FM Server 21.1 no longer requires the use of Base64Encode or decoding for WebDirect solutions. Indeed, it no longer seems to work with Base64 encoding in WebDirect. But not having to do the encoding and decoding at all results in meaningfully faster interaction with the web viewer.

Have a nice day.

2 Likes

That's very interesting. To put it another way, earlier versions of FMS were not able to encode and/or escape the code contained in a webviewer. The base64 encoding/decoding ensured that the web viewer got to see the code you intended it to see. FMS v21.1 is now able to handle the code without mangling it. That's very good news.

3 Likes