@@ -503,6 +503,12 @@ class DuckWidget {
503
503
// If this is a login button, show modal if needed
504
504
if ( this . replaceSettings . type === 'loginButton' && entityData [ this . entity ] . shouldShowLoginModal ) {
505
505
return e => {
506
+ // Even if the user cancels the login attempt, consider Facebook Click to
507
+ // Load to have been active on the page if the user reports the page as broken.
508
+ if ( this . entity === 'Facebook, Inc.' ) {
509
+ notifyFacebookLogin ( )
510
+ }
511
+
506
512
handleUnblockConfirmation (
507
513
this . platform . name , this . entity , handleClick , e
508
514
)
@@ -656,6 +662,7 @@ function createPlaceholderElementAndReplace (widget, trackingElement) {
656
662
657
663
// Facebook
658
664
if ( widget . replaceSettings . type === 'dialog' ) {
665
+ ctl . messaging . notify ( 'updateFacebookCTLBreakageFlags' , { ctlFacebookPlaceholderShown : true } )
659
666
if ( widget . shouldUseCustomElement ( ) ) {
660
667
/**
661
668
* Creates a custom HTML element with the placeholder element for blocked
@@ -922,13 +929,26 @@ function handleUnblockConfirmation (platformName, entity, acceptFunction, ...acc
922
929
}
923
930
}
924
931
932
+ /**
933
+ * Set the ctlFacebookLogin breakage flag for the page, to indicate that the
934
+ * Facebook Click to Load login flow had started if the user should then report
935
+ * the website as broken.
936
+ */
937
+ function notifyFacebookLogin ( ) {
938
+ ctl . messaging . notify ( 'updateFacebookCTLBreakageFlags' , { ctlFacebookLogin : true } )
939
+ }
940
+
925
941
/**
926
942
* Unblock the entity, close the login dialog and continue the Facebook login
927
943
* flow. Called after the user clicks to proceed after the warning dialog is
928
944
* shown.
929
945
* @param {string } entity
930
946
*/
931
947
async function runLogin ( entity ) {
948
+ if ( entity === 'Facebook, Inc.' ) {
949
+ notifyFacebookLogin ( )
950
+ }
951
+
932
952
const action = entity === 'Youtube' ? 'block-ctl-yt' : 'block-ctl-fb'
933
953
const response = await unblockClickToLoadContent ( { entity, action, isLogin : true , isSurrogateLogin : true } )
934
954
// If user rejected confirmation modal and content was not unblocked, inform surrogate and stop.
@@ -1845,6 +1865,12 @@ export default class ClickToLoad extends ContentFeature {
1845
1865
}
1846
1866
// Handle login call
1847
1867
if ( event . detail ?. action === 'login' ) {
1868
+ // Even if the user cancels the login attempt, consider Facebook Click to
1869
+ // Load to have been active on the page if the user reports the page as broken.
1870
+ if ( entity === 'Facebook, Inc.' ) {
1871
+ notifyFacebookLogin ( )
1872
+ }
1873
+
1848
1874
if ( entityData [ entity ] . shouldShowLoginModal ) {
1849
1875
handleUnblockConfirmation ( this . platform . name , entity , runLogin , entity )
1850
1876
} else {
0 commit comments