Giter Club home page Giter Club logo

acrool-window-launcher's Introduction

Acrool Window Launcher

Acrool Window Launcher Logo

This is a window launcher for front-end compatibility with browser issues when using window.open.

NPM npm npm

npm downloads npm

Features

  • Supports window.open after asynchronous requests in iOS Safari.
  • Supports whether to close the old window when opening a new one
  • Provides browser detection (Safari, Firefox, IE, Wechat, Line, Facebook), default is Chrome.

Installation

yarn add @acrool/window-launcher

Examples

use in your page/component:

import {Launcher} from '@acrool/window-launcher';

const launcher = new Launcher({
    readyUrl: '/ready_page'
});

// This is to support safari, so it must be
// Safari needs to pre-open tabs before requesting, other browsers do not need to
launcher.ready();

// async requet
const response = await fetch('/url1.json');
const json = await response.json();

launcher.open(json.data);

Check Browser

import Launcher, {
    checkIsMobile,
    checkIsAndroid,
    checkIsIOS,
    getBrowser,
    checkIsChromeBrowser,
    checkIsSafariBrowser,
    checkIsFirefoxBrowser,
    checkIsEdgeBrowser,
    checkIsLineBrowser,
    checkIsFacebookBrowser, checkIsWebview, checkIsPWA
} from '@acrool/window-launcher';

Check OS

import Launcher, {
    checkIsMobile,
    checkIsAndroid,
    checkIsIOS,
} from '@acrool/window-launcher';

There is also a example that you can play with it:

Play react-editext-example

License

MIT © Acrool & Imagine

acrool-window-launcher's People

Contributors

imagine10255 avatar

Stargazers

 avatar Ralf avatar Chiu avatar Barry Allen avatar  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.