1

I'd like to launch multiple HTMLViewer controls. Each should be manage its own cookie storage. If HTMLViewer_1 is already logged in on a site, e.g. HTMLViewer_2 should be able to log in using another role.

Q: How to I isolate HTMLViewer instances against each other?
SteAp
  • 11,853
  • 10
  • 53
  • 88

1 Answers1

-1

If I understand your question correctly, I think you should sub-class the HTMLViewer so that the subclassed control can be customized to handle cookie storage (a Property of type Dictionary?) and other custom Methods for any required handling.

Subclassing makes any customized logic or data you add to the HTMLViewer self-contained, when the subclassed control is then added to your UI. A subclassed custom control can be reused multiple times, where each occurrence is a separate instance (with its own internal data).

If you design your new subclassed capabilities well enough, you can hide (Private scope) or encapsulate complexity (new Public Methods) to help make each future use of your subclassed control much easier.

If you're not familiar with subclassing in Xojo, maybe this link can help UserGuide:Subclassing Examples. Also checkout Xojo's YouTube series, there is an example of subclassing a Canvas. Canvas is of course a different control than HTMLViewer, but the actions required in the IDE are basically the same.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • @ScottCaillac Sorry, this is no solution of the problem. I may subclass HTMLViewer and define further properties, but these will not influence the internal behavior of the HTMLViewer. HTMLViewer has an internal state, where it stores cookies and thus state. Since HTMLViewer does not allow to replace the cookie storage by some own handler, one may not run several isolated instances of HTMLViewer in a single application. All HTMLViewer instances share the one and only on cookie storage feature. – SteAp May 11 '21 at 22:45