I am using ActionTypes.OpenUrl to create the link which opens in new tab, is there any workaround to open the link in new window. DirectLine is used to connect to Bot. Thankyou
Asked
Active
Viewed 473 times
-2
-
what have you tried post that so that we can help you – Ronak Shetiya Aug 10 '18 at 13:27
-
Hi @priti, any updates? Do you solve the problem? – Fei Han Aug 29 '18 at 09:35
1 Answers
0
I am using ActionTypes.OpenUrl to create the link which opens in new tab, is there any workaround to open the link in new window.
To achive your requirement, you can try to implement and use a customized version of the webchat. In AdaptiveCardContainer.tsx
, modify the code to open a new window, like below:
private onExecuteAction(action: Action) {
if (action instanceof OpenUrlAction) {
/*window.open(action.url);*/
window.open(action.url, "_blank","toolbar=no");
} else if (action instanceof SubmitAction) {
if (action.data !== undefined) {
if (typeof action.data === 'object' && (action.data as BotFrameworkCardAction).__isBotFrameworkCardAction) {
const cardAction = (action.data as BotFrameworkCardAction);
this.props.onCardAction(cardAction.type, cardAction.value);
} else {
this.props.onCardAction(typeof action.data === 'string' ? 'imBack' : 'postBack', action.data);
}
}
}
}
For more information about implement a customized webchat, please refer to “Building Web Chat”.
Test result:

Fei Han
- 26,415
- 1
- 30
- 41