What is considered the most modern and robust way to do a browser (engine) based redirect? - redirect

e.g. for installing a browser extension if you wanted to have a single page that sends users to either the Chrome App store or Firefox add-ons page based on just the name of the browser but but underlying extension compatibility (e.g. Chromium based browsers, incl.Edge ,Opera, Brave to Chrome store, Firefox and Tor browsers, Palemoon etc. to Firefox add-on store, and Safari to an error page.
I know you can name them by user agent individually, but is there a more robust way that's more future-proof and relies on the underlying browser engine for the redirect logic?

Related

How to make a REST API chrome extension

I want to make an extension that uses REST API. This extension should receive word fields in address https://api.datamuse.com/words?ml=book.
I would start by reading how to develop Chrome extensions here.
"Extensions are small software programs that can modify and enhance the functionality of the Chrome browser. You write them using web technologies such as HTML, JavaScript, and CSS.
A screenshot of an extension's icon in the browser bar Extensions have little to no user interface. For example, the image to the right shows the icon that provides the UI for the Google Mail Checker extension.
Extensions bundle all their files into a single file that the user downloads and installs. This bundling means that, unlike ordinary web apps, extensions don't need to depend on content from the web.
You can distribute your extension using the Chrome Developer Dashboard to publish to the Chrome Web Store. For more information, see the store developer documentation. "

Making Chrome web app standalone desktop program

Google announced that they drop support for web apps in Chrome.
Basically, web app is a local HTML/CSS/JS app that runs in a separated custom "standalone" Chrome window.
Is there any way (preferably easy), to convert this web app to a real desktop app that not depend on Chrome in anyway? Using maybe NodeJS? If yes what is the right way to do it?
Thanks.
You could try one of these tools:
https://applicationize.me/
https://www.bzgapps.com/coherence
https://fluidapp.com/ (for Mac only)
Don't know about "easy", but it seems to me that the natural evolution is to Electron or NW.js, and both of these are mentioned in the Google blog article on this subject. (I'm moving to Electron.) Both have advantages over Chrome Apps, mostly that they are true desktop applications. To cite one example, you can now manipulate the menu bar, something out-of-bounds for Chrome Apps.
Pure JavaScript code in your Chrome App, such as anything to access the internet, should move over directly. Same for much UI stuff, as you're still using a browser window for the UI. The app will, however, have to be restructured.
Added Note: Chrome Apps ran on 4 platforms: MacOS, Windows, Linux, ChromeOS. Electron and NW.js apps won't run on ChromeOS. So, the ability to write a four-platform completely binary-portable app is going away.

How do I test web pages opened in an Eclipse internal browser view.

We are developing an Eclipse plugin that opens web pages in a view using the Eclipse web browser (typically IE on Windows).
Are there any testing tools that support Eclipse (to drive the parts using Eclipse/RCP) and also able to drive the web browser views.
At a minimum I'd want to be able to get elements by ID or xpath, and to send click events to elements in the browser.
We know Quick Test Pro doesnt do this, and can't see anything that explicitly supports Eclipse web browser views.
You can check with QFS , we used this tool for SWT/JFace UI automation and this tool also supports web. You can to check if this supports your test case.

IPhone Safari 302 Redirects open new windows

I have a fairly standard ASP.Net web application which is used via mobile safari on the iPhone.
Some users who have a link to the web application placed on their desktop via profile are reporting that when navigating between pages (which I do on the server with Response.Redirect after specific events or via standard anchor tags in other cases (no target specified)) that Safari opens a new window instead of reusing the existing window.
Because of this, any login token/cookie etc (i'm using the built-in ASP.Net membership stuff), is now gone for that new browser window and the login prompt is shown.
The problem doesn't happen every time, and I can't seem to replicate it on my device (but i'm not deploying the shortcut via profile)
As you can probably imagine, it's quite frustrating for the users to have to log in every time, and you can't fix an issue you can't replicate.
My question is, has anyone heard of this issue and/or know a workaround?
The app is NOT iPhone specific, that is, it is used in a full desktop browser as well, and the logins stay like you'd expect there - and the same window is reused repeatedly.
I've considered a few possibilities, but have been drawing a blank as far as what might be causing this or how I can resolve it.
Do you have any iPhone meta tags set (to remove the url bar or the toolbar, for instance?) If you do, the phone will assume it's a native web app, and urls will open in a new safari window, like they would for any other native app.
If you are taking advantage of using the web app in full screen mode (where it is bookmarked to the launch screen next to native apps) you can prevent it from jumping out of fullscreen mode by and in to safari replacing type links with javascript.
location.href = '/yourPath';
This is a nifty trick which even works if you are linking to an outside URL, like doing an OAuth to Facebook and back.
I have a blog post on this here: http://www.aaroncoleman.net/post/2011/07/29/Keeping-iPhone-Web-App-in-Fullscreen-mode-from-Homescreen-Launcher.aspx

How do I develop a Web based application in ASP.NET 3.5 that can be viewed on an iPhone 3G?

I want to develop a mobile web application using asp.net 3.5 that can be viewed on an iPhone but there is no longer a template in VS2008 to enable mobile development. Can this be done ?
the iphone uses the "regular" version of your website so developing a "mobile" version would nto accomplish what you're looking for. You should check the browser headers and redirect people to the iPhone version of your site if you detect mobile safari.
http://iphone.facebook.com/
Another option (if you're using MVC) is to have your controller detect the browser and show a different view if it catches mobile safari. This way you wouldn't need a duplicate site, just two sets of views.
A web application (via Asp.Net 3.5) would be accessible over the Internet and would be accessible via the iPhone's Safari browser. There isn't anything truly special you need for it unless you want to make a true web application for mobile devices like the iPhone and Blackberries. In that case, you are looking purely at design aspects since it's still just a website. Due to the diversity of mobile browser capabilities, you'll need to do some research to find out what is recommended for the specific mobile browsers you want to access (the BBC's website comes to mind as a good example of mobile rendering).
Ultimately, the user agent is evaluated by your system and then it renders (or redirects) appropriately. Everything else is design if you want the page to render differently for the iPhone than any other browser on the web.
If you can get your hands on a copy of .Net magazine (a.k.a. Practical Web Design in the U.S.) issue 178, there is a great article on what you need to be aware of when doing mobile development and how the iPhone's browser is a lot different than others.
The iPhone (at least mine which is the 3G version) have full support for "normal" web apps with Ajax and everything. So mostly any Ajax library would be 100% compatible with the iPhone, at least as long as the Ajax library is focusing on Open Standards and such...
[Shameless-Plug I work with Ra-Ajax]
Ra-Ajax have 100% support for iPhone except for "dragging and dropping" which interferes with scrolling on the iPhone. This means that you can use Ra-Ajax (which is an LGPL licensed and Free of Charge library for ASP.NET) to create a "normal" website which will work 100% perfectly (except for dragging and dropping, which is used in e.g. Ra-Windows etc) on the iPhone...
Even the really "advanced" stuff like our Ajax Calendar sample works flawlessly with the iPhone :)