Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@yorkjs/web-page

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yorkjs/web-page

web page life cycle

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
2
Weekly downloads
 
Created
Source

web-page

监听网页 showhideenterleave 事件。

安装

CDN

<script src="https://unpkg.com/@yorkjs/web-page"></script>

NPM

npm install @yorkjs/web-page

YARN

yarn add @yorkjs/web-page

示例

import * as WebPage from '@yorkjs/web-page'
WebPage.addEventListener(
  WebPage.SHOW,
  function (data) {
    console.log('show', data)
  }
)
WebPage.addEventListener(
  WebPage.HIDE,
  function (data) {
    console.log('hide', data)
  }
)
WebPage.addEventListener(
  WebPage.ENTER,
  function (data) {
    console.log('enter', data)
  }
)
WebPage.addEventListener(
  WebPage.LEAVE,
  function (data) {
    console.log('leave', data)
  }
)

API

init()

初始化。

addEventListener(type, listener)

监听事件,仅支持对外暴露的常量事件。

兼容性

  • showhide 事件仅适用于支持 visibilitychange 事件的浏览器。
  • enterleave 事件仅适用于支持 pageshowpagehide 事件的浏览器。

Keywords

FAQs

Package last updated on 17 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc