Email and Help toolbar buttons don't work

Post Reply
c-ionrosc
Jr. Propeller Head
Posts: 2
Joined: Thu Feb 07, 2019 6:18 am

Email and Help toolbar buttons don't work

Post by c-ionrosc »

Hello everyone,

I performed all the steps from:

https://docs.madcapsoftware.com/flare20 ... torial.pdf

and my buttons still don't work. I get them displayed in the output, but nothing happens when clicked.

Can someone advise on what could be the problem.

Thank you!
AlexFox
Sr. Propeller Head
Posts: 251
Joined: Thu Oct 19, 2017 1:56 am

Re: Email and Help toolbar buttons don't work

Post by AlexFox »

Hi, welcome to the forums!

I would strongly advise you provide more information, as people are unlikely to be able to help with a vague query.

Can you tell us exactly what you are trying to achieve, the code you are using, and importantly, any errors you see in your browser developer tools when you click the buttons/load the page?
c-ionrosc
Jr. Propeller Head
Posts: 2
Joined: Thu Feb 07, 2019 6:18 am

Re: Email and Help toolbar buttons don't work

Post by c-ionrosc »

Hi,

sure, thanks.

So, the scope is to add a button on the toolbar that, when clicked, opens the support.company.com link.
I performed all the steps described in the pdf, but when the output is generated, the button is visible, but nothing happens when clicked.

After investigating a bit, I found this error:

The Content Security Policy (CSP) prevents cross-site scripting attacks by blocking inline execution of scripts and style sheets.

To solve this, move all inline scripts (e.g. onclick=[JS code]) and styles into external files.

⚠️ Allowing inline execution comes at the risk of script injection via injection of HTML script elements. If you absolutely must, you can allow inline script and styles by:

adding unsafe-inline as a source to the CSP header
adding the hash or nonce of the inline script to your CSP header.


The thing is that even if I move the button's on-click action to a .js external file, I don't know how to link to it from the toolbar skin settings.

Can someone help?
AlexFox
Sr. Propeller Head
Posts: 251
Joined: Thu Oct 19, 2017 1:56 am

Re: Email and Help toolbar buttons don't work

Post by AlexFox »

Try using a jQuery function in the toolbar javascript section:

Code: Select all

$(document).ready(function() {
    $(".help-button").on("click", function() {
        window.open("https://www.google.com", "_blank");
    });
});
You'll need to change google.com to your support link and the help-button class to a unique identifier for the button, which you can find by inspecting it in the output.
Post Reply