MCPcopy Create free account
hub / github.com/ampproject/amphtml / start

Method start

third_party/subscriptions-project/swg.js:14111–14133  ·  view source on GitHub ↗

* Starts the Link account flow. * @param {{ampReaderId: (string|undefined)}=} params * @return {!Promise}

(params = {})

Source from the content-addressed store, hash-verified

14109 * @return {!Promise}
14110 */
14111 start(params = {}) {
14112 this.deps_.callbacks().triggerFlowStarted(SubscriptionFlows.LINK_ACCOUNT);
14113 const forceRedirect =
14114 this.deps_.config().windowOpenMode == WindowOpenMode.REDIRECT;
14115 const args = params.ampReaderId
14116 ? feArgs({
14117 'publicationId': this.pageConfig_.getPublicationId(),
14118 'ampReaderId': params.ampReaderId,
14119 })
14120 : feArgs({
14121 'publicationId': this.pageConfig_.getPublicationId(),
14122 });
14123 const opener = this.activityPorts_.open(
14124 LINK_REQUEST_ID,
14125 feUrl('/linkbackstart'),
14126 forceRedirect ? '_top' : '_blank',
14127 args,
14128 {}
14129 );
14130 this.deps_.eventManager().logSwgEvent(AnalyticsEvent.IMPRESSION_LINK);
14131 this.dialogManager_.popupOpened(opener && opener.targetWin);
14132 return Promise.resolve();
14133 }
14134}
14135
14136/**

Callers

nothing calls this directly

Calls 11

feArgsFunction · 0.85
feUrlFunction · 0.85
triggerFlowStartedMethod · 0.80
callbacksMethod · 0.80
configMethod · 0.80
getPublicationIdMethod · 0.80
logSwgEventMethod · 0.80
eventManagerMethod · 0.80
popupOpenedMethod · 0.80
resolveMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected