Socket
Book a DemoInstallSign in
Socket

@dfeidao/fd-am000001

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfeidao/fd-am000001

阻止Android用户按下物理返回键

latest
npmnpm
Version
4.6.201909161524
Version published
Maintainers
1
Created
Source

阻止页面跳转

Installation

yarn add --dev @dfeidao/fd-am000001

Params

属性描述
fd
will_block是否阻止页面跳转
action触发的响应事件

Example

import IFeidaoAiMobile from '@dfeidao/fd-am000000';
import am01 from '@dfeidao/fd-am000001';

export default async function a001(fd: IFeidaoAiMobile){
	// 这里的逻辑判断需要在用户按下物理返回键时提示用户,当前页面不关闭
	const data = {
		foo: 'bar'
	};
	am01(fd, true, 'a002', data);
}

export default async function a002(fd: IFeidaoAiMobile, data: {foo: string;}){
	// 比如说在这个响应中弹出了一个用户提示框,
	// 而又户又确认了可以关闭该页面,这个时候认为页面可以正常返回了,再次调用即可
	const force_close = confirm('close this?');
	if (force_close) {
		am01(fd, false, '');
	}
}

注意

  • 是否阻止页面跳转,注意,只对Android的返回物理键起使用,使用调用其它原子操作的方式不起使用
  • 如果在多个响应中调用该原子操作,则最后一次的调用起使用。

Keywords

feidao

FAQs

Package last updated on 16 Sep 2019

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