Skip to content

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

@MiniOcean404

Description

@MiniOcean404

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

解决方案(建议):
在执行监控初始化后执行 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 ()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions