BranchMetrics / web-branch-deep-linking-attribution

The Branch Web SDK for deep linking and attribution. Once initialized, the Branch Web SDK allows you to create and share links with a banner (web only), over SMS, or your own methods by generating deep links. It also offers event tracking, access to referrals, and management of credits.
https://help.branch.io/developers-hub/docs/web-sdk-overview
MIT License
287 stars 101 forks source link

Extension mv3 support #833

Closed hoyangtsai closed 1 year ago

hoyangtsai commented 1 year ago

Describe the feature

Suppose running the branch in the background which is able to generate an universal link between content and popup.

There are errors when init the SDK since mv3 background running with service worker only.

JagadeeshKaricherla-branch commented 1 year ago

@hoyangtsai can you provide us more info about the issue

hoyangtsai commented 1 year ago

I have an extension running by react and redux. I want to the data to be persistent, the utils to be used whenever needed, so the branch-sdk will be initialized at the background. When I need a deep link, I dispatch an action to the background to create it by branch.

hoyangtsai commented 1 year ago

BTW now I init the sdk at the background, and even disabled the event tracking.

// init Branch
branch.init(
  'key_live_YOUR_KEY_GOES_HERE',
  {
    tracking_disabled: true,
  }
);

I got this error. console-error

error-code

JagadeeshKaricherla-branch commented 1 year ago

Manifest version 3 does not support background pages, it only supports service workers. That means you have no DOM or Document or window. Currently Branch web-sdk doesn’t support scenarios where document is not available. We have an archived manifest v2 based chrome extension : https://github.com/BranchMetrics/branch-chrome-extension