mailto: links gobbled in a route - backbone.js

I'm using the jquery linkify plugin on a relatively simple Backbone view. Links to web pages outside this app work properly and using browser view source, I see the mailto links are properly generated. But clicking a mailto link appends /mailto:q#example.com to the current URL (e.g., http://example-acme.staging.myservername.com/mailto:q#example.com).
If I copy the generated HTML using Inspector and paste it into the source of arbitrary pages (not in this app), the mailto links function as expected, opening a new message window from my mail client. Problem is the same in Chrome and Firefox.
Have you seen and fixed this issue?

Just for closure: I added an event handler in the handler use window.location.assign(mailto) and that gets the job done. Not necessarily 'correct' but practical. #Brad, thanks for chiming in!

Related

Adding looker extension ID to hyperlinks in Extension Framework applications when opening as new tab

I am making an web application on the Looker Extension Framework. It contains several links (routes) for different components to be rendered.
Since those are links, they could be opened as a new tab or window when the mouse is right clicked on it. These are relative links, so when the links are opened externally, the host url (in this case, the looker instance) will be automatically added so that it becomes "https://hosturl/mylink". However, extension ID is not added and the links become broken. For example if the link is “/hello”, URL will become “https://mylookerinstance.com/hello” which leads to a 404 error. The correct (expected) link have to be "https://mylookerinstance.com/extensions/myextensionid/hello".
I have tried BrowserRouter to make the basename to be “/extensions/myextensionid” but since my application is already rooted at “/extensions/myextensionid”, clicking the link directly (not opening it as a new tab) would not work anymore as it would become “/extensions/myextensionid/hello”, not “/hello”.
Is there anyway to add extension ID to it so that the link could become “https://mylookerinstance.com/extensions/myextensionid/hello”? (myextensionid will be something like “my-project::my-application”.

How do I get my button to redirect to a web page within the app?

So far, I have it so that when a user presses a button, a browser opens and redirects the user to my desired url. However, I want this to happen within the app instead of a web tab. How can I do this?
Use the BrowserComponent, just add it to the center of a border layout form and set the URL for that component. Check out the list of main components in Codename One within the developer guide.
Define a xml layout containing a widget called webview. Then in your activity you implement a listener to your button which invokes that xml with the desired page to load inside your webview. Google to find some code and return here with your code problems, if you find some. If this will be the case, open new questions provinding detailed info about your matters then we can help more. Best.
EDIT: Excuse me, just now, re-reading your question I think I really understand it, and the solution is very simple, just a line of code (to instruct your app to open a webpage inside your webview, and not the regular browser, outside your app). Try this:
wv = (WebView) findViewById(R.id.myWebView);
wv.setWebViewClient(new WebViewClient()); // needed to open url inside our webview, otherwise it will open at the default browser
wv.loadUrl(url);

How to get button Response/Request URLs in QTP?

How do I get Response/Request URLs (which are shown in F12 Developer tools - Network Tab) using QTP 11? Based on these URLs, I need to perform certain action in my application. Is there any alternate solution to get those URLs?
Scenario: Open IE browser and navigate to a URL, Press F12, Go to 'Network' tab. Click on 'Start Capturing' button. Now click on any button or link on the page, you will get a set of URLs in the Developer Tool (F12).
Firstly, do you need all of the URL requests generated from a button and/or link click? Remember that what you get from the "Network" tab in the developer tools also include URL's for fetching e.g. Javascript and CSS in addition to, for instance a GET request to an external API.
I'll try an provide you with an alternative approach. If what you are really requiring is the URL associated with each interactive element, then you should be able to get that by using the GetROProperty method like so:
strURL = Browser("YourBrowser").Page("MainPage").WebButton("aButton").GetROProperty("href")
A more generic script for fetching e.g. all the "href" properties for all the links on a page may be found in the following post: (HP QuickTest) How do I get HTTP status using QuickTest?.
Hope this helps.
UPDATE: With regards to your question regarding fetching of the URL's from the IE developer tools; As far as I know there is no way to fetch them from this view by using QTP.

A Link Inside an iFrame That Pops Up "Photo Theater"

I have a tab with an iframe external web page that loads... I would love a hyperlink inside that web page to link one of my photo albums in "theater" mode so you don't leave the page. However, any link I program inside that web page just brings in that photo album inside (not popped up and not in theater mode no matter if I have the &theater in the url).
Can I get some help on how to do this? Thanks!
this is a limitation of iframes in general. Less of a limitation and more of a security issue. As you said.. the iframe loads and external page - a page that could essentially come from anywhere. To protect the integrity of the site displaying this external page, the iframe can not access the page that contains it.
You might want to try opening a new window using javascript :
window.open ("{path_to_image}","title","menubar=1,resizable=1,width=350,height=250");
as you can see there are several options that you can set to customize the popup window.
Here is another link with some info about iframes

Issues w/ Silverlight Navigation Page + window.location.hash

I have silverlight navigation pages (with NavigationCacheMode="Required").
When i normally navigate to these pages (via mouse clicks) the pages get loaded as expected (they are only created once due to the cache attribute).
However, I have a need to update the url in the browser address bar.
When I update this via javascript ("window.location.hash=#...") the address and page gets displayed, BUT the page gets re-created - which is causing other issues.
In particular the issue that this is causing is that the page has a Prism.regions defined in the xaml. So it throws an error complaining about a region that has already been registered.
Has anyone tried something similar to this?
I dont think there is a way to update the url in the address bar without the browser navigating to it. Note that the url that im trying to update to includes query string paramters, which is not directly "known" by the silverlight navigation framework.
The last resort that i havent tried is to register all the unique Urls with the navigation framework.
I found an hack. simply cancel the frame_navigating event when ever the url is being updated manually. works great.

Resources