The browser() directive allows you to place a web browser window on the screen and control output. This is useful for displaying reference information (current customer sale details) and capturing information. Browser windows only include the display area, not address bars, buttons or other attributes.
Browser windows can be controlled by POS-Script so that you can change what is displayed, print output, or change URLs
Web pages that are browsed too can call back into the POS and read/write to the active sales. This is extremely useful if you are writing web pages to process business logic, but if you are loading external web pages from the internet generally you are relying on these web pages not to affect POS state.
The browser loaded is controlled by Windows and it is not the default browser selected at user level. This means it will be the Internet Explorer browser. Technically, the browser is loaded as an ActiveX control. See below for more details about selecting the version of browser used.
at(left,top,right,bottom)
Specifies the top left and bottom right corner of the browser.
The "right" and "bottom" parameters can be set to -1, which causes the window to stretch to the extreme right or bottom of the current UI window. This is useful for placing a browser on the right side of the screen and having it fill any remaining space.
tip(%s)
Loads a tooltip to be displayed for this control.
font(%s)
url(%s)
resize(%s)
Controls if the browser is resized when the parent window is resized. A list of "x" or "y" should be used to indicate which direction the control should resize, although current versions only check for the presence of any value to resize in both the X and Y directions.
You are advised to test various resize scenarios with a screen if you use this option.
register(%s)
Provides a name for this browser so that it can be controlled from POS Script. The name must be unique at a global level as any screen/script can control any browser.
hook(%s)
dynamic
Indicates that the url() parameter should be evaluated via symbol substitution and reevaluated each time a hook point fires. This allows the browser to change to different values as the POS context changes.
retailmax
Reserved to Fieldpine.
redraw(%d)
minsize(min-x-width, min-y-height)
The parameters must be greater than zero. Specify "1" if you are not concerned with a direction.
Example: minsize(50,20) declares that the browser must be at least 50 pixels wide and 20 pixels high.
datebefore(date)
dateafter(date)
timeafter(time)
timebefore(time)
onlydays(mask)
condif(condition)
Examples of Use
Placing a web page on the screen, using the current POS as the web server.browser define at(800,10,-1,-1) minsize(400,80) url(http://127.0.0.1:8095/CustomerDisplay.htm) resize(x1,y1) register(hb) execute end
Display a GDS widget on screen and have it react to the current customer on the sale.
browser define at(800,10,-1,-1) resize(x1,y1) url(http://MasterServer/report/pos/widgets/customer_top_pid.htm?cid=%salecustomer.cid%) dynamic hook(20100,20101) execute end
Display a GDS widget on screen to display chain wide stock levels and have it change according to the current selected product. This browser is condition on the setting SiteCanSeeStockLevels being set.
browser define at(800,10,-1,-1) resize(x1,y1) condif(%data.setting.SiteCanSeeStockLevels% gt 0) url(http://MasterServer/report/pos/widgets/singlepidlevels.htm?pid=%data.workingsaleline.pid%) dynamic hook(20100,20101) execute end
Create a browser that displays an image for the current product.
browser define at(802,10,1068,260) url(http://MasterServer/report/pos/widgets/Image_Flipper.htm?area=202) register(bif1) dynamic hook(20100,20101) execute end
Controlling Browser Version
The version of the browser used by PosGreen.exe is controlled by Windows. If you do not explicitly set the version, PosGreen (versions P1904 and higher) will attempt to set the version to the preferred version from Fieldpine. Alternatively, you can explicitly set the version, by changing the following registry key.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION] "posgreen.exe"=dword:00002af9 On 64 Bit systems, the registry setting is [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION] "posgreen.exe"=dword:00002af9
The POS operation is controlled by the setting BrowserVersionLock. If this setting is not defined the POS will do whatever it feels is correct. If the setting is defined to "lock", the POS will not attempt any changes to the registry. Otherwise, the POS will attempt to set the registry to the value of this setting.
Different version of IE will render the same HTML in different ways. The users may notice that pages change their appearance slightly
For more technical information about this registry value and the meanings of different values, refer to the Microsoft website