Giter Site home page Giter Site logo

openfin-onclose-customlogic's Introduction

Application/Platform OnClose Logic

  This example shows how you can perform an action when an OpenFin window
  application or platform closes. I have used preload scripts (see the
  config files in the config folder) to load this logic without requiring
  changes to the window application main page or the need for a custom
  platform provider.

  The logic from these files in the preload folder can be added to the
  script of the main window in a window application or a custom provider for
  the platform.

  Another important thing to point out is the runtime arguments section of
  the config files. This config file specifies some args: a security realm
  so that this application is isolated from other applications and the mesh
  argument so that the application can still communicate on the message bus
  with others.

  You can use the <b>Add Settings</b> in the browser or once you have
  launched an OpenFin window application or platform using the links and button on the index.html page.

  In all cases a cookie with a time entry will be added (which should expire
  in a day) and a localstorage entry will be added.

  The difference is when you close the browser or re-open the application.
  The browser will still have both values but the OpenFin applications will
  not. We clear everything but the logic in the preload could be more
  specific and doesn't have to clear data (it could be some other on close
  logic).

The codesandbox can be found here: https://codesandbox.io/s/openfin-onclose-customlogic-9onyq

Or you can go direct to the url if you just want to launch instead of looking at the code: https://9onyq.csb.app/

Some things you will need to update if you want to run your own copy or if you have forked this from codesandbox:

In config/app.platform.fin.json, config/app.window.fin.json update:

  • uuid : make the uuid unique
  • visit https://www.openfin.co and request a trial/developer license
  • update the url field to reflect your codesandbox url
  • update the application icon to reflect your own icon
  • update the name and description to reflect your application
  • update the security realm to something specific to your application

More information about OpenFin:

openfin-onclose-customlogic's People

Contributors

johnman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.