@baloise/web-app-unsupported-browsers

3.14.0 • Public • Published

@baloise/web-app-unsupported-browsers

Continuous Release npm npm bundle size npm GitHub GitHub issues

This script verifies if the users browser is supported by the Baloise applications and if not it redirects directly to the static unsupported-browsers pages.

Installation

Fist we install the javascript package with npm.

npm install @baloise/web-app-unsupported-browsers

The javascript file needs to be served as a static file therefore use the package copyfiles

npm install copyfiles --save-dev

After installing our copyfiles dependency we need to define the copy command in our package.json file. Add a new script called copy:script and adjust the second path to your application.

Then we add the defined script copy:script in our postinstall script. Every time we install dependencies the copy:fonts script gets executed at the end.

"scripts": {
  "postinstall": "npm run copy:script",
  "copy:script": "copyfiles --flat node_modules/@baloise/web-app-unsupported-browsers/dist/* public/assets/js"
}

Lets add the script to the head of the entry html page.

<head>
  ...
  <script
    src="public/assets/js/baloise-unsupported-browsers.js"
    data-location="ch"
  ></script>
</head>

Attributes

The script supports two attributes:

  • data-location
    • default is ch
    • possible values are ch,be,lu and de
  • data-language
    • default is browser-language if supported and if not then the default of the location
      • ch would be de
      • be would be fr
      • lu would be fr
      • de would be de

Readme

Keywords

none

Package Sidebar

Install

npm i @baloise/web-app-unsupported-browsers

Weekly Downloads

2

Version

3.14.0

License

Apache-2.0

Unpacked Size

17.1 kB

Total Files

4

Last publish

Collaborators

  • assistentenitch
  • madalina.iacob
  • yannickholzenkamp
  • montakasparsone
  • team_mortal
  • mladenplaninicic
  • nobilo
  • thomasseyssenstpo
  • se-aperto-com
  • baopso
  • hirsch88