Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

监控导致小程序全局会有转发、分享朋友圈功能 #65

Open
MiniOcean404 opened this issue Sep 2, 2022 · 0 comments
Open

Comments

@MiniOcean404
Copy link

MiniOcean404 commented Sep 2, 2022

监控导致小程序全局会有转发、分享朋友圈功能

解决方案(建议):
在执行监控初始化后执行 noMonitorPageLift 将分享功能重置为其原有方式,并且此方式貌似不会影响监控功能

MITO.init()

const WX_PAGE_LIFT = ['onShareAppMessage', 'onShareTimeline']

const originPage = Page

const noMonitorPageLift = (cb) => {
  cb()

  Page = (options) => {
    WX_PAGE_LIFT.map((lift, index) => {
      const originMethod = options[lift]

      WX_PAGE_LIFT[index] = { name: lift, method: originMethod }
    })

    originPage.call(this, options)

    WX_PAGE_LIFT.forEach((liftInfo) => {
      originPage[liftInfo.name] = liftInfo.method
    })
  }
}

noMonitorPageLift ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant