@taole/dev-helper 0.1.26 → 0.1.27-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -277,12 +277,17 @@
277
277
  _handleAlinkClick(event) {
278
278
  this._writeClickboard();
279
279
  this._cancelLaunchFallback();
280
- if (this._alink_link === this._alink_fallback) {
281
- // 没有可用的拉端链接,点击本身就是兜底。
282
- if (this._useOpenInstall()) {
283
- event.preventDefault();
284
- this._wakeupOpenInstall();
280
+ if (this._useOpenInstall()) {
281
+ event.preventDefault();
282
+ if (this._alink_link !== this._alink_fallback) {
283
+ // 默认的 a 标签跳转发生在事件处理完成之后,先主动执行拉端。
284
+ this._openFallbackLink(this._alink.href);
285
285
  }
286
+ // 在同一次点击中调用,尽可能保留 SDK 写剪贴板所需的用户激活状态。
287
+ this._wakeupOpenInstall();
288
+ return;
289
+ }
290
+ if (this._alink_link === this._alink_fallback) {
286
291
  return;
287
292
  }
288
293
  // 先使用原链接拉端,页面没有隐藏才执行兜底。
@@ -300,10 +305,6 @@
300
305
  this._clickLink = false;
301
306
  }
302
307
  _openFallbackLink(href) {
303
- if (this._useOpenInstall()) {
304
- this._wakeupOpenInstall();
305
- return;
306
- }
307
308
  const link = document.createElement('a');
308
309
  link.href = href;
309
310
  link.click();
@@ -272,12 +272,17 @@ function createOpenDiandianElementClass() {
272
272
  _handleAlinkClick(event) {
273
273
  this._writeClickboard();
274
274
  this._cancelLaunchFallback();
275
- if (this._alink_link === this._alink_fallback) {
276
- // 没有可用的拉端链接,点击本身就是兜底。
277
- if (this._useOpenInstall()) {
278
- event.preventDefault();
279
- this._wakeupOpenInstall();
275
+ if (this._useOpenInstall()) {
276
+ event.preventDefault();
277
+ if (this._alink_link !== this._alink_fallback) {
278
+ // 默认的 a 标签跳转发生在事件处理完成之后,先主动执行拉端。
279
+ this._openFallbackLink(this._alink.href);
280
280
  }
281
+ // 在同一次点击中调用,尽可能保留 SDK 写剪贴板所需的用户激活状态。
282
+ this._wakeupOpenInstall();
283
+ return;
284
+ }
285
+ if (this._alink_link === this._alink_fallback) {
281
286
  return;
282
287
  }
283
288
  // 先使用原链接拉端,页面没有隐藏才执行兜底。
@@ -295,10 +300,6 @@ function createOpenDiandianElementClass() {
295
300
  this._clickLink = false;
296
301
  }
297
302
  _openFallbackLink(href) {
298
- if (this._useOpenInstall()) {
299
- this._wakeupOpenInstall();
300
- return;
301
- }
302
303
  const link = document.createElement('a');
303
304
  link.href = href;
304
305
  link.click();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/dev-helper",
3
- "version": "0.1.26",
3
+ "version": "0.1.27-beta",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "dev-helper": "./bin/dev-helper.js"