I’m trying to utter a link to the chat with the javascript action. The javascript works, but only without the attribute “target” if I remove this attribute it works as expected.
I know, but I was hoping someone here already done it.
But I was debugging the Botfront and it seems a bug, there’s a feature to react that when the URL starts with “javascript” or “docviewer” it already removes the target attribute, for the normal web interface the target is fixed.
I’m forking the repo now to confirm it (I was debugging the minified source) and as I confirm it I’ll adjust and send a PR.
So, if you could please keep this open so I can update for future use I appreciate it.
I was able to make it work but was a team effort, I had to adjust Botfront for RASA as the SocketChannel from rasa, I’m gonna explain and as you if I should do a PR to RASA about it.
At Botfront, it had implemented some treatment to deal with target when the URL starts with “mailto” or “javascript”, but it wasn’t very well implemented, so I made some fixes, the link to PR is below:
At RASA Socketchannel.py I had to add some treatment to quick replies because they can be of two types, the default with a payload or the type “web_url” which carry a URL instead Payload, the channel was ready to deal only the default type (with payload), below I show the changes. Let me know if I should open a PR to it.
Before:
for button in buttons:
messages[-1]["quick_replies"].append(
{
"content_type": "text",
"title": button["title"],
"payload": button["payload"],
}
)
After:
for button in buttons:
b = {
"content_type": "text",
"title": button["title"]
}
if "type" in button:
b["type"] = button["type"]
if "payload" in button:
b["payload"] = button["payload"]
if "url" in button:
b["url"] = button["url"]
messages[-1]["quick_replies"].append(b)