Skip to main content
added 128 characters in body
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

So this is probably an irrelevant error?

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

One related post is lightning:navigation not passing the States in URL.

Does anyone understand what part here makes the navigation occur and what I can try to make the navigation work?

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

So this is probably an irrelevant error?

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

Does anyone understand what part here makes the navigation occur and what I can try to make the navigation work?

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

So this is probably an irrelevant error?

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

One related post is lightning:navigation not passing the States in URL.

Does anyone understand what part here makes the navigation occur and what I can try to make the navigation work?

added 35 characters in body; edited title
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

A click on a bell icon notification in Communities (now called Digital Experiences) generates a browser errordoesn't navigate

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

Anyone have this working? Any insights intoSo this problem?

(Based on a quick read ofis probably Cryptographic nonce, this appears to be a security mechanism.)an irrelevant error?

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

Does anyone understand what part here makes the navigation occur and what I can try to make the navigation work?

A click on a bell icon notification in Communities (now called Digital Experiences) generates a browser error

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

Anyone have this working? Any insights into this problem?

(Based on a quick read of Cryptographic nonce, this appears to be a security mechanism.)

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

A click on a bell icon notification in Communities (now called Digital Experiences) doesn't navigate

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

So this is probably an irrelevant error?

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

Does anyone understand what part here makes the navigation occur and what I can try to make the navigation work?

added 271 characters in body
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

Anyone have this working? Any insights into this problem?

(Based on a quick read of Cryptographic nonce, this appears to be a security mechanism.)

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

Anyone have this working? Any insights into this problem?

(Based on a quick read of Cryptographic nonce, this appears to be a security mechanism.)

Having managed to get notifications to appear by not including a "state" and so using:

Map<String, Object> pageRef = new Map<String, Object>{
    'type' => 'comm__namedPage',
    'attributes' => new Map<String, Object>{
        'name' => 'cvcp__event-details'
    }
};
notification.setTargetPageRef(JSON.serialize(pageRef));

a click on a notification item generates a browser error (in Chrome) of e.g.:

Refused to run the JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'nonce-GzsQXTm1bMh16s0QBEqIhyq4Vrp152Im' https://service.force.com/embeddedservice/ import: blob:". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

The Salesforce Platform generated link is:

<a class="notification-link" href="javascript:void(0)" ...>
    ...
</a>

Anyone have this working? Any insights into this problem?

(Based on a quick read of Cryptographic nonce, this appears to be a security mechanism.)

There is a successful POST request made to:

https://.../portal/s/sfsites/aura?r=14&ui-notifications-components-notifications-controller.Notifications.markNotificationRead=1

at the same time but that looks like just an update that the notification has been read.

added 145 characters in body
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458
Loading
Source Link
Keith C
  • 137.3k
  • 29
  • 218
  • 458
Loading