Chatbot open link in parent window - chatbot

I am totally new using Chatbot and I'm creating a chatbot using the Microsoft Bot Framework. Chat window is opened in an iframe.
I want to display a link in the chat message and open the link in the parent window itself (not in a new window or new tab). Is it possible to achieve this?
Otherwise can I automatically redirect to any url in my parent window from chat window?

Your question has 2 answers:
1: Yes, it is possible to change the parent window, or top window, to another URL. (Provided the browser's security mechanism allows it: eg. both pages are hosted on the same domain and no special security restrictions have been added to the iframe)
You can do this using javascript:
window.parent.location.href = '<url to browse to>';
Or html:
Link
2: When you change the URL of the parent page (the page with the iframe), your iframe will no longer be visible, since you are redirecting to a new page.
Since you will therefore close the iframe, and thus the chat window, this might not be what you want to do. My advice would be to use a new tab for links; this not only makes for a better user experience, but will also make it so you don't have to worry about security settings in browsers changing and then breaking your application.

Related

Making page tab searchable?

I have a client that wants their tab application to be searchable in Facebook. You can search for the application itself just fine, but the result comes up separate from the page (with no way of leading back to the page itself).
Is it possible to make a page tab searchable? If not, is there a way of detecting whether or not an application is within a tab (so we could display a custom link back to the page)?
Thanks!
It´s not possible to make a page tab searchable at this moment. Apps are searchable, so the solution should be use a specific app. With that app, you can render content in your tab. But when users search, they will land in your app canvas (not in the tab) but you can redirect back to you tab url with javascript. Place this code in your canvas app view:
window.location = "your_tab_url"

Facebook Tab on pages

Whats the best way to develop a tab on facebook in a facebook page with content inside it? Would it just be html within that tab?
Easiest way is to install a 3rd party iframe App on your Facebook Page. You can find these Apps by searching for "iframe" in Facebook's search. Once you have one of these Apps installed, you can customize the HTML/CSS/JS of the iframe, which will then be reflected on you Page Tab. Alternatively, you could create your own Facebook App and install it as an iframe in your Facebook Page. This will achieve the same thing, and may give you more control, but you will have to host the html/css/js files yourself and it will be more work.
I recently have the same need.
To just place a facebook tab containing just a static html with text and image.
Here are the steps. It can be quite a nightmare to review the documentation of Facebook since it is always in change.
In the home page, click in the settings button. There is a link "Create application". You have to be sure to be in the Facebook development section
In the Create Application home page. In the upper menu there is the button "Applications". Here will be listed all your applications. If this is the first time, again the button "Create a new app"
3.Enter the information requested. Name of the application, an identifier (I prefer the same display name without spaces) and choose a category.
As a security step, a captcha is shown. Just fill with the characters in the screen.
Since your tab is an html. You have to host this file in your own server in order to have a path. The first tricky thing here is to convert this file into a php, asp, or similar extension. since Facebook uses GET or POST protocol to send information. You have to ensure that your file understands this requests. So, your server must accept the corresponding programming language. Even if your tab doesn't have any real code.
The configuration of your app is shown in screen. In the left menu, the option "configuration" displays the options to activate your tab.
click "Add plattform" button and select Facebook tab
fill the information required with the corresponding URLs. Note: Facebook always requires secured URLs so make sure that your server or hosting service has the SSL certificate validated.
Upload the image of your tab to be shown in the home of your profile in your tab section.
ok, so far we are good. Now. This was a long search. There is no longer the "Add to my webpage" link anywhere. So use this link to access to that hidden link. here Basically you enter the facebook app id and the URL of the hosted file.
Then you select the facebook page where you want to link this tab. And that's it!
note: the alternative to the link is this: (https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&next=YOUR_URL )
Hope this helps. It was a waste of time when I have to search for the details so I want to share this.

MVC Facebook application - dual template

Maybe this is a stupid question and I did not understand exactly how Facebook applications work but here it goes
I want to implement a small e-shop as a Facebook application and for the products to have like button. The application will be instaled on a business page.
The problem is that the link for the like post on the wall will be to the actual eshop not to the facebook application on the business page.(or is it possible to make it to the application (eg. when you click the browser goes to the business page, selects the eshop tab, opens the product)?)
So actually I need to make a eshop site with 2 templates one for outside view and one for IFrame facebook view.
Is it possible to detect (from code-behind not in javascript) If the request is from the iframe or directly from outside?
Or the solution is more simple.. create a small version of the shop for browsing products only to be viewed in facebook and a full shop for outside view and the only relation between them is that when you click the like post from the first one you go to the second one?
I think I have found a solution...
I have created 2 domains that point to the eshop
shop.domainname & facebook.shop.domainname.
And in code behind I can check the Request.Url.Host if it starts with facebook.
For the facebook app the canvas url will be with facebook.shop.domainname and the links from the like button will be for the shop.domainname.
In this way I should be able to use 2 templates for the site and detect witch one I shoul use....

Are lightbox-style popups allowed when using Google Adwords?

Google's AdWords policies state:
Pop-Ups
Don't use pop-up windows on your site.
We do not approve destination URLs that generate pop-ups when users enter
or leave your landing page.
We consider a pop-up to be any window, regardless of content, that opens
in addition to the original window.
This includes pop-unders, timed or intermittent pop-ups, mock system
warnings, and pages that automatically initiate a download.
Does anyone know if that includes Lightbox effect popups that occur within the same browser window, and just lay on top of the content? The terms "popup" and "window" are ambiguous in the above policy, and it's not clear whether by "window" they mean simply the browser window, or whether the Lightbox content would count as a new window.
Anyone know for sure?
As long as the lightbox opens only on user's direct action of, supposedly, clicking a thumbnail to open a bigger version, I don't think it's treated as a popup per se.
Opening a pop-up/pop-under on page open or leave, or through clickjacking is evil and those are the cases condemned by the policy.
Here's a blog post from Adwords team about why popups are disapproved. You can see that lightbox does not fit the profile.

Redirect to a link using the default broswser in Windows Form based application

I am not use: Process.Start (String, String) to open a link. But every time the browser open a new tab or new window to open the link.
Is there a way that to open the link in the latest opened page? Just redirection, no new tab or new window?
This is not really up to you (the programmer) to decide but to the user: Some browsers have an option for this setting. You shouldn't try modifying the user's selected browser behaviour.
Someone of my team did this once in an instant messenger application that we were writing, without asking for other opinions first. The users were super annoyed that our application kept overwriting their opened pages.