Keyfax
  • 📋What is Keyfax?
  • Product Suite
    • Keyfax Administrator Tools
      • System Requirements
      • Installation
      • Logging On
      • Navigation
      • Exclusive Mode
      • Script Levels
        • Master Scripts
          • Category Editing
          • Topic Editing
          • Self-Service Categories
        • System Scripts
          • Cancel
          • Priority Justifications
          • Results
          • Special Instructions
          • Startup
        • Script Sets
          • Category Properties
          • Setting up Topics
          • Topic Properties
          • Loading Script Sets
      • Script Editing
        • Script Editing - The basics
        • References
        • Testing your changes
        • Script Flows
      • Script Entities
        • Databoxes
          • Script Data
            • Host-specific notes
          • SQL Query
            • Testing SQL Query Databoxes
          • Import XML
          • Export XML
          • System Values
          • Company Data
          • Testing Databoxes & Expressions
          • Databox Read
          • Databox Write
          • Databoxes in Messages & Tasks
        • Questions
          • Address
          • Checklist
          • Date/Time
          • Dynamic Lists
            • Testing Dynamic Lists
            • Dynamic List Examples
          • External Forms (eForms)
            • External Forms - Technical
          • File Upload
          • List
          • Numeric
          • Text
          • Video Call
        • Asset Data
        • Markers
        • Messages
          • Testing Messages
        • Services
          • Host-specific notes
        • Priorities
        • Tasks
          • Enclosures & Attachments
          • Continuations
          • Host-specific notes
      • Reports
      • Databox Examples
        • Business Days
        • Working Hours
        • Time of day
        • Higher priority jobs
        • Script Duration
        • How did it happen?
        • Repair Description
        • Concatenating CSV
        • Tenant Handbook
        • Multi-line Addresses
        • Priority / Response Days
        • Contains Text
      • Databox Expressions
        • Text Expressions
          • CSV
          • Entry
          • Exists
          • FieldMerge
          • Index
          • IndexOf
          • InList
          • Item
          • Len
          • ListTidy
          • Lower
          • PadLeft
          • Replace
          • Row
          • RowMerge
          • SubStr
          • Trim
          • Upper
          • WCase
        • Numeric Expressions
          • Abs
          • AsNum
          • Between
          • Int
          • Mod
          • Number
          • Result
          • Round
        • Date Expressions
          • After
          • AsDate
          • Before
          • BetweenDates
          • DateAdd
          • Day
          • Month
          • Now
          • Today
          • WeekDay
          • Year
        • Number Formatting
        • Operators And Literals
        • Logical Expressions
        • Additional Functions
          • Ds
      • Users
        • Finding active users
        • Keyfax SSO – via Microsoft Entra ID Support
      • Advanced
        • Base Task Templates
          • Email Task Templates
          • Letter Task Templates
          • Note Task Templates
          • SMS Task Templates
          • VoiceSage Task Templates
          • Host-specific notes
        • Export & Import
        • Communications Queues
      • Host Operations
        • ActiveH Operations
          • Introduction
          • Actions
          • Databoxes & UDEs
          • Emails
          • Mail Merge Letters
          • Populating CallType
          • Populating JobType
          • Repairs Inspection Task
          • Repairs Interface
        • Fast Lean Smart
      • Best Practices
        • Extracting XML from Keyfax tables
        • Script Performance
        • Handling multiple rows from SQL
        • HTML Editor
        • Writing SQL Queries
      • Known Issues
        • Startup Messages
        • Running but not Visible
        • Error 1001 During Install
        • Stopped Working
    • Keyfax Staff
      • System Requirements
      • Advisor Feedback
      • Priority and Quantity
    • Keyfax Self-Service
      • System Requirements
      • Browser Support
    • KeyNamics
      • Model Driven Apps
      • Power Pages Portals
      • Installation
        • System Requirements
        • Solution Import
        • Basic Setup
        • Known Issues
      • Embedding
        • Model Driven Apps
        • Power Pages Portals
      • Configuration
        • Settings
        • Mappings
          • Creating Mappings
          • Minimum Mapping Requirements
          • Mapping Entity Form Fields
          • Mapping Lookup fields
          • Mapping Examples
        • FetchXML
          • Creating FetchXML queries
        • Logging
        • Test
      • Advanced
        • Mode Translation Rules
        • Customising Launch Button
        • Extending Export Data
        • Mapping Dump Fields
        • Mapping JSON Results
        • Enabling Help Panes
        • Mobile Operation
        • Handling uploaded content
      • Technical
        • Topology
        • Copying Environments
        • Keyfax Startup Data
        • Keyfax Export Data
    • Keyfax Client
      • Installation
        • Getting Started
        • Launch Tester
        • Uninstall / reinstall
        • Known Issues
    • Keyfax Cloud
      • Uptime Guarantee
      • Business Continuity
  • General
    • General FAQs
      • General Questions
      • Installation Questions
      • Migration Questions
      • Security Questions
      • Test & Training Questions
    • Keyfax FAQs
      • Keyfax Administrator Tools
      • Keyfax Staff
      • Keyfax Self-Service
      • KeyNamics
      • Keyfax Client
      • Keyfax Cloud
    • Issues & Solutions
      • Emails not working
    • Release Notes
      • Keyfax
        • 4.4.7
        • 4.4.6
        • 4.4.5
        • 4.4.4
        • 4.4.3
        • 4.4.2
        • 4.4.1
        • 4.4.0
        • Previous Releases
      • Keyfax Client
        • 4.0.0.44
        • 4.0.0.43
        • 4.0.0.42
        • Previous Releases
      • KeyNamics
        • 3.0.0.0
        • 2.0.0.13
        • Previous Releases
      • Older Releases
        • Staff
  • Integrations
    • API Docs
      • REST API
        • Quick Start
        • Deep Dive
        • API SDKs
          • .NET SDK
          • JavaScript SDK
          • Start-Up Data
          • Processing Results
        • API Reference
      • SOAP API
        • Quick Start
        • Error Handling
        • Status Codes
        • XML Schemas
          • Startup Schema
          • Results Schema
          • Results with Note
          • Cancelled Schema
          • Address data
      • Legacy APIs
        • Active X
        • Asynchronous Pluggable Protocols
        • XmlHttp
    • Integrations
      • Aareon
        • Introduction
        • Launching Keyfax Repairs
        • Launching Keyfax Enquiries
        • Configuration
        • SOAP based integration
        • QL Message fields
        • Known problems
      • Accuserve
      • ActiveH Desktop
        • Introduction
        • ActiveH Repair Interface
        • Known Problems
        • Keyfax Configuration
          • MISExchange.xml
          • Example Settings
          • Retrieving Block Codes
        • MIS Configuration
          • Exchange Process
          • Exchange Elements
          • User Permissions
          • User Security
          • UDE Interface
          • UDE Configuration
          • Settings
          • Desktop Configuration
          • Priorities Configuration
          • Populating Job Type
          • Populating Assigned To
          • Populating Call Classification
          • Configuring Log Call
            • Launching Keyfax from Response Repairs
          • Workflow Integration Actions
        • MIS interface Objects
          • CRM Gateway
          • Desktop Task
          • System Task Email Addressee
          • Desktop Task Action
          • Repair Request
          • Repair Request Inspection
          • Repair Request Task
      • ActiveH Portal (TIPS)
        • Introduction
        • Settings
        • Known Issues
      • ActiveH Web
      • Breeze IT
      • Caltech
      • Capita
        • Capita Housing / Academy
          • Host Table Usage
          • Troubleshooting
        • Open Housing
      • Civica
        • Civica CX
          • Introduction
          • Mappings
          • Start Up Data
          • Inspections
          • Known Issues
        • Civica CM
          • Known problems
        • Servitor
          • Example Import XML
          • Example Export XML
      • ContactView
      • Dynamics
      • Kirona
      • Lagan
      • MIS
      • MRI
      • Northgate
        • Launching Keyfax
        • Exchange process
        • XML/Field mappings
      • OneServe
      • ROCC
      • Total Mobile
        • Launching Keyfax (TASK)
        • TotalView Configuration
      • SDM
    • Best Practices
      • Integration Considerations
      • Displaying Keyfax Self-Service
  • Technical
    • General
      • Keyfax Architecture
      • Clearing Cache
    • Cloud Operation
      • Microsoft Azure
      • Amazon Web Services
    • Configuration Settings
      • Introduction
      • Paths Element
    • Developer Zone
      • eForm Technical Details
    • SQL Server
      • Freeing Space
      • Maintaining Indexes
      • Maintenance Plan
      • Restoring Live into Test
  • Links
    • Our Web Site
    • Our Blog
    • Try Keyfax
    • Contact Us
Powered by GitBook
On this page
  • Why choose a tab or pop-up window over an iframe?
  • Pop-Up Considerations
  • Example pop-up window integration
  • Handling users closing the pop-up
  • Closing the pop-up once Keyfax completes
  • Displaying a pop-up overlay
  • How does this work on a device with constrained screen space
  1. Integrations
  2. Best Practices

Displaying Keyfax Self-Service

Our recommendations for displaying Keyfax Self-Service.

PreviousIntegration ConsiderationsNextGeneral

Last updated 1 year ago

NOTE This information is not applicable to Keyfax Staff as Keyfax Staff is already generally launched within it's own unique browser control or browser tab.

This article relates to Keyfax Self-Service integrations where you may wish to display Keyfax Self-Service from within your existing tenant portal.

Unlike Keyfax Staff where advisor access can be closely controlled, tenants can access Keyfax Self-Service on a wide variety of browsers and devices and as such Omfax Systems would encourage integrators to keep any Keyfax Self-Service integration as simple as possible to support the broadest range of browsers and devices.

When integrating Keyfax Self-Service into your tenant portal we would generally suggest using a pop-up window to display Keyfax or simply opening Keyfax within the same browser tab or a new browser tab. We would generally advise avoiding an iframe to display Keyfax as iframes have various usability issues and security restrictions.

Why choose a tab or pop-up window over an iframe?

Browsers are increasingly blocking 3rd party cookies. Features such as Intelligent Tracking Protection (ITP) within WebKit & Privacy Sandbox within Chromium block all 3rd party cookies (cookies on requests to domains that are not the same as the domain showing within the browsers address bar). In many cases 3rd party cookies are blocked by default regardless of the samesite and or secure cookie attributes which can have unexpected side effects within Keyfax.

Apple has forced browser vendors on iOS / macOS to adopt ITP and as part of this 3rd party cookies must be disabled by default by browsers on iOS/macOS. Chrome will be deprecating support for all 3rd party cookies at the end of 2023 with a feature called .

As browsers are blocking 3rd party cookies more and more to help future proof host integrations Omfax Systems would not recommend displaying Keyfax within a 3rd party / cross-domain iframe and instead if Keyfax and your host application need to be installed on different domains would recommend displaying Keyfax as a 1st party web site either by displaying Keyfax within a browser pop-up window or a full browser tab. Displaying Keyfax within a pop-up window allows the browser to display the browser address bar at the top of the pop-up window to the user and so the browser treats pop-up windows as 1st party web sites.

For the best user experience and most reliable, future proof Keyfax integration Omfax Systems would generally suggest displaying Keyfax as a 1st party web site. Omfax Systems can visually customise the look and feel of your Keyfax installation to perfectly match your existing tenant portal or branding to provide a more seamless, consistent experience to your end-users.

Pop-Up Considerations

Displaying Keyfax within a pop-up window will ensure Keyfax is presented as a 1st party web site however pop-up windows do come with their own drawbacks. For example it's possible the pop-up window could be blocked by a users pop-up blocker and / or the user may need to perform additional steps to allow the pop-up window.

For the best possible end-user experience Omfax Systems would generally suggest simply displaying Keyfax within the same browser tab or within a new browser tab and having Keyfax return to your tenant portal after Keyfax completes.

Example pop-up window integration

Our KeyNamics for Power Pages Portals integration already displays Keyfax within a pop-up window as shown here...

The full JavaScript code used for this example can be found here...

The full CSS code used for this example can be found here...

In the below examples we'll share some basic code and considerations to help you achieve a similar behavior with your Keyfax integration. Please remember however that the code presented below is the minimal to help you get started and we would encourage you to review the full JavaScript & CSS linked above for a more complete working example.

Displaying Keyfax within a pop-up window

Once Keyfax has returned a launch URL (after you call the start-up web service) you would typically take this launch URL and display this within a browser pop-up window. To help we've provided the following createPopUp() method below...

var newWindow = null; // A global here for convenience / readability purposes - you would want to consider scope here and possibly wrapping this within a object literal or closure to avoid polluting the global scope
function createPopUp(url, title, w, h) {

    var screenX = typeof window.screenX !== 'undefined' ? window.screenX : window.screenLeft,
        screenY = typeof window.screenY !== 'undefined' ? window.screenY : window.screenTop,
        outerWidth = typeof window.outerWidth !== 'undefined' ? window.outerWidth : document.documentElement.clientWidth,
        outerHeight = typeof window.outerHeight !== 'undefined' ? window.outerHeight : document.documentElement.clientHeight,
        isMobile = function () {
            return (outerWidth <= 1024);
        },
        targetWidth = isMobile() ? null : w,
        targetHeight = isMobile() ? null : h,
        V = screenX <= 0 ? window.screen.width + screenX : screenX,
        left = parseInt(V + (outerWidth - targetWidth) / 2.5, 10),
        top = parseInt(screenY + (outerHeight - targetHeight) / 2.5, 10),
        features = [];

    // Build features
    if (targetWidth !== null) {
        features.push('width=' + targetWidth + "px");
    }
    if (targetHeight !== null) {
        features.push('height=' + targetHeight + "px");
    }
    features.push('left=' + left);
    features.push('top=' + top);
    features.push('scrollbars=1');
    features.push('popup=1');

    try {
        // Attempt to open
        newWindow = window.open(url, title, features.join(','));
        // Detect if the pop-up window was blocked and present a friendly message
        if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') {
            // Display blocked message
        }
    } catch (e) {
        // Log
        if (window.console) {
            window.console.log("An error occurred opening the Keyfax pop-up window. Error: " + e.message);
        }
    } finally {
        // Set focus if window opened successfully
        if (newWindow !== null && newWindow !== undefined && !newWindow.closed) {                
            if (newWindow.focus) {
                newWindow.focus();
            }
        }
    }

};

function getViewportSize(w) {

    // Use the specified window or the current window if not supplied
    w = w || window;

    // This works for all browsers except IE8 and before
    if (w.innerWidth !== null) {
        return {
            w: w.innerWidth,
            h: w.innerHeight
        };
    }

    // For IE (or any browser) in Standards mode
    var d = w.document;
    if (doc.compatMode === "CSS1Compat")
        return {
            w: d.documentElement.clientWidth,
            h: d.documentElement.clientHeight
        };

    // For browsers in Quirks mode
    return {
        w: d.body.clientWidth,
        h: d.body.clientHeight
    };

}

You would call the createPopUp() method like so...

// Get view port dimensions
var viewPortSize = getViewportSize(window);
// Show pop-up slightly smaller than the current view port
createPopUp("https://demo.keyfax.biz/Interview/Main/Main.aspx?guid=KF-5fd93ebe-b103-4e45-97da-124a4f92835e&co=DemoLive#", "Keyfax", Math.floor(viewPortSize.w - 200), Math.floor(viewPortSize.h - 200));

Handling users closing the pop-up

To detect if users close the Keyfax pop-up window additional client-side JavaScript code would be necessary. In the above example we use a setInterval JavaScript timer to continually check the pop-up window status and if the code detects the window has been closed the parent or opening page can be updated to inform the user.

To achieve this we'll add a new addPopUpCloseListener method which will periodically check the newWindow global variable as defined above. This new method can be seen below...

var popupInterval = null; // Again defined as a global variable for convenience / readability
function addPopUpCloseListener() {

    // Ensure pop-up is active
    if (newWindow === null) {
        return;
    }

    // Poll to check when pop-up window is closed
    popupInterval = window.setInterval(function () {
        if (newWindow  === null) {
            // Remove pop-up close listener
            removePopUpCloseListener();
            // Return early
            return;
        }
        if (newWindow.closed) {
            // Update parent page DOM to display "Window Closed" message
            // Remove pop-up close listener
            removePopUpCloseListener();
            // Reset window reference
            newWindow = null;          
        }
    }, 100);

}

function removePopUpCloseListener () {
    if (popupInterval) {
        window.clearInterval(popupInterval);
    }            
}

This listener should be added immediately after calling createPopUp. For example...

// Get view port dimensions
var viewPortSize = getViewportSize(window);
// Show pop-up slightly smaller than the view port
createPopUp("https://demo.keyfax.biz/Interview/Main/Main.aspx?guid=KF-5fd93ebe-b103-4e45-97da-124a4f92835e&co=DemoLive#", "Keyfax", Math.floor(viewPortSize.w - 200), Math.floor(viewPortSize.h - 200));
// Add pop-up window close listener
addPopUpCloseListener();

Closing the pop-up once Keyfax completes

To close the pop-up window once Keyfax has completed you would typically pass in a "ReturnURL" as part of the Keyfax start-up data to return the user back to a custom page once Keyfax completes. This custom page would contain client side code to either automatically close the pop-up window or allow the user to manually close the window.

For example to automatically close the pop-up window you would simply invoke window.close() when the user lands back on the custom completed page. You could also optionally add a button to allow the user to close the window and simply add window.close() into the buttons click handler.

You can also invoke client-side JavaScript code on the parent / opening page. For example if you had a global method on your parent page called handleKeyfaxCompleted you could invoke this method from the custom completed page within the pop-up window like so window.opener.handleKeyfaxCompleted(). The handleKeyfaxCompleted() method on your parent page could be responsible for updating DOM elements on your parent / opening page to thank the user for the submission or perform additional logic.

Displaying a pop-up overlay

Whilst not functionally required you'll notice in the above KeyNamics for Power App Portals example the background becomes blurred when you open the Keyfax pop-up window. This is achieved by adding a semi-transparent overlay and applying a blur effect to parent pages CSS whenever the Keyfax pop-up window is active. Whilst beyond the scope of this guide if you wanted to achieve a similar effect we would encourage you to review the showPopUpOverlay() and hidePopUpOverlay() methods within the full JavaScript linked above. The full CSS used is also linked above.

How does this work on a device with constrained screen space

For example on a mobile device you would typically not have enough screen space to display a pop-up window.

Mobile browsers are aware of this and all mobile browsers we've tested seem to treat the call to window.open() similar to a regular anchor tag with a target="_blank" attribute, You'll notice on a mobile device or tablet that a pop-up window won't display and instead the browser will simply spawn a new tab. The mobile browser is aware this tab was opened in the context of a pop-up window and allows calls to window.close() to automatically close the tab if desired.

Privacy Sandbox
https://keynamicsportal.powerappsportals.com/page/minimal/
https://keynamicsportal.powerappsportals.com/keyfax.js
https://keynamicsportal.powerappsportals.com/keyfax.css