oBrowser PDF

malkishtini at gmail.com malkishtini at gmail.com
Fri Jan 27 20:36:44 UTC 2023


Hi all,
Just sharing what I've learn this past weekend about oBrowser and the JSClientbridge in case it helps someone in the list.

After deploying our Studio client app(that runs the oBrowser) and the web app (that runs the jsclient forms) to testing servers, where the client app is installed on a different server than the studio web app, I started getting CORS policy error:

oBrowser (file:///C:/Program%20Files/Omnis%20Software/OS%2010.22/htmlcontrols/jsclient_bridge/scripts/core.bundle.js:3) Access to XMLHttpRequest at 'file:///C:/Program%20Files/Omnis%20Software/OS%2010.22/htmlcontrols/jsclient_bridge/themes/default.css' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, d

The solution was by adding the two attributes below to the "cefSwitches" section in the config file of the Studio client app that runs oBrowser.
"obrowser": {
        "cefSwitches": [
            "allow-file-access-from-files",
            "disable-web-security"
        ],

I was testing on Windows 2019 servers and IIS.

Hope this info helps someone.
Best regards,
Mayada

-----Original Message-----
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of IT
Sent: January 27, 2023 3:47 AM
To: OmnisDev List - English <omnisdev-en at lists.omnis-dev.com>
Subject: Re: oBrowser PDF

Hi Doug,

"locale": “es-ES”,

in config.json did the job.

I’m beginning to use oBrowser but requires a learning step but seems very powerful.

I will try to deepen with oBrowser and will take a look to cefSwitches.

Thank you Doug,

regards

xavier





> El 27 ene 2023, a las 0:41, Doug Easterbrook via omnisdev-en <omnisdev-en at lists.omnis-dev.com> escribió:
> 
> hi Xavier
> 
> 
> oBrowser is built out of chromium embedded framework (typically called 
> CEF for short)
> 
> in config.json in the studio folder, there is a section for oBrowser, 
> and withoin that a section for cefSwitches
> 
> 
> in my example have none
> 
> 
> 
>   "obrowser": {
>       "cefSwitches": [
> 
>       ],
>       "clearCacheWhenLoaded": true,
>       "clearLocalStorageWhenClearingCache": false,
>       "defaultHtmlcontrolsFolderInDataFolder": false,
>       "htmlcontrolsFolder": "",
>       "locale": "en-GB",
>       "logSeverity": 99,
>       "messageTimeout": 60,
>       "remoteDebuggingPort": 5989,
>       "useLayeredViewsMacOS": false,
>       "useOmnisTraceLogForConsole": true
>   },
> 
> 
> 
> 
> 
> however, I was trying to do some cross site stuff and when talking to Omnis support, they gave me some settings to try (per below)
>          "allow-universal-access-from-files",
>          "allow-insecure-localhost"
>          "allow-loopback-in-peer-connection",
>          "allow-running-insecure-content"
> 
> 
> so, I might suggest you start looking for CEF switches, of which I’ve given some samples.    I didn’t do an extensive gooogle search, but this seemed ot show the code for some
> 
> https://chromium.googlesource.com/chromium/src/+/32352ad08ee673a4d43e8
> 593ce988b224f6482d3/chrome/common/chrome_switches.cc
> 
> 
> 
> 
> the other think that strikes me is the option in the oBrowser section 
> above
> 
> 
> "locale": "en-GB",
> 
> and a google search of that yeilded this web site where the person talks about german.   https://magpcss.org/ceforum/viewtopic.php?f=6&t=17672
> 
> 
> 
> I have not tried any of this.        However, its what I’d start looking at since I know oBrowser is a wrapper on Chromium embedded and it responds to some of the config parameters consistently with chromium embedded.
> 
> 
> hope that gives you a place to start.
> 
> 
> 
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 650-1978
> 
>> On Jan 26, 2023, at 7:38 AM, IT <it at plastipol.com> wrote:
>> 
>> Hi,
>> 
>> I’m using oBrowser to show PDF documents successfully for desktop. The only shortcoming is that I’m unable to control the the default aspect.
>> 
>> For example there is a menu ‘More Actions’ with text in English.
>> 
>> How I tell to oBrowser to use Spanish?
>> 
>> Regards
>> 
>> x
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com Start a 
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com Start a 
> new message -> mailto:omnisdev-en at lists.omnis-dev.com

_____________________________________________________________
Manage your list subscriptions at https://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list