Detect browser ClickOnce support with JavaScript - javascript

I see that ClickOnce is still supported by Microsoft in Visual Studio 2019 / .NET 5/6.
But installing from the web page is only supported with IE, Edge (not Chromium, where is is disabled by default), or Firefox and Chrome with an unofficial plugin...
Is there a way, with JavaScript, to detect if the current browser support ClickOnce or not ?

Related

Node.js web browser with JavaScript execution

Is there a node / npm module which would scrape the contents of a web page or a given URL and execute and evaluate it's JavaScript as a real-life web browser, including XMLHttpRequest object and alike?
I thought that scraperjs was the solution, but sadly it isn't.
All help very appreciated!
Headless browsers based on rendering engine:
Chrome (blink) => Playwright or Puppeteer
Firefox (gecko) => Playwright
Safari (webkit) => Playwright
Puppeteer is the official automation tool for Chrome. It only supports Chrome/Chromium browsers, (with experimental support for Firefox).
Playwright is an alternative to Puppeteer, with support for more browsers, written by the original creators of puppeteer, who jumped ship from Google to Microsoft. It supports Chrome, Firefox and Safari browsers
Previous versions of my answer, included PhantomJS, SlimerJS,CasperJS and Nightmare all of which are no longer maintaned. For modern browsers, just use one of the above

Internet Explorer ver 11 enterprise mode detection

Recently my team has landed in a weird situation. End of last year we migrated from IE 8 to IE 11. Our application is now designed to work in IE 11 Enterprise mode.
We need to display a javascript alert message to upgrade the Browser if the user is using IE 8. Alert message is successfully displayed to the users who use IE 8. But problem occurs when the alert message is also displayed to the users who are using IE11 in enterprise mode. I know that IE11 Enterprise mode basically emulates IE 8 behavior and that is the reason why our browser detection functionality is failing.
So I wanted to check if someone has implemented this kind of feature where they can successfully detect the IE version even if they are using IE 11 enterprise mode.
All responses are valuable. Appreciate your response !!!
As per MSDN:
As of Internet Explorer 11, the user-agent string has changed
significantly...Sites that rely on the user-agent string should be
updated to modern techniques, such as feature detection, adaptive
layout, and other modern practices.
https://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx
Although IE11 in EM throws
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Tablet PC 2.0)
It is not advisable to just look for "MSIE" in the userAgent but rather try:
var isIE11 = !!navigator.userAgent.match(/Trident.*rv[ :]*11\./)
I'm just looking into this myself. I did stumble across this recently - but couldn't get it to work reliably - however the concept of looking for a feature of IE that shouldn't normally be available is sound.
My plan now is to use IETruth to get the version number (it's very good at doing version detection for IE11) and then do something like:
var IE = IeVersion();
if(IE.TrueVersion < 9 && ('spellcheck' in document.createElement('textarea')) {
// must be running in Enterprise mode because spellcheck wasn't introduced until IE10
}
I'll let you know how I get on!
You can use document mode to check for Enterprise mode. Because in EM the document mode is set to IE 5 to IE 8. This check along with your browser check functionality should work.
How to get browser "Document Mode"

Firefox addon compatibilty with version 11

I made an addon for Firefox and it works with the latest version. My problem is that I want it to work with all versions of Firefox. How can I do this?
Info:
I used the Add-on SDK to make the extension.
I use jQuery too in my extension, could it come form here?
Add-on SDK 1.14 (the current release) marks add-ons compatible with Firefox 19 and disallows installation in older Firefox versions. If you don't like that you have several options:
Edit app-extension/install.rdf in your Add-on SDK install and set minVersion to something other than Firefox 19. If your extension is simple you might even get away with that and your extension will actually work in older Firefox versions, maybe even in Firefox 4 (definitely not below that however, restartless extensions were introduced in Firefox 4). This is obviously not supported and verifying that everything really works correctly (e.g. no memory leaks) will be close to impossible.
You can get an old version of the Add-on SDK. You will not get any of the improvements in the newer Add-on SDK versions but you get support for old Firefox versions. You will still need an Add-on SDK version that's compatible to at least Firefox 10 however, otherwise your add-ons won't install in current Firefox versions (Firefox 10 is where the "compatible by default" switch was flipped). Also, regardless of compatibility flags - while your extension might work correctly in current Firefox versions, it's just as likely that it won't.
You can drop the Add-on SDK and just create a classic extension. Then you can set the compatibility boundaries to anything you like. Taking care of backwards compatibility will also be your responsibility however - and depending on what range of Firefox versions you want to support this is a very non-trivial task.
The main question is however: why do you want that? The current Extended Support Release is Firefox 18, so no version below Firefox 18 is supported by Mozilla. There are of course a few users on outdated Firefox versions for some reason but people who don't update also rarely go install new extensions. So, do you really want to spend tons of time making your extension work in Firefox 1.0 (release 2004)? How about Firefox 4 (released 2011)? How much effort do you want to invest into staying compatible with old versions when there are tons of addon-relevant changes in each single release?
You should read the addon compatibility page on the sdk documentation.
https://addons.mozilla.org/en-US/developers/docs/sdk/1.14/dev-guide/guides/firefox-compatibility.html
Did you simply try to change the minVersion field in your install.rdf file?

Where is DeviceMotionEvent currently implemented?

The DeviceOrientation specification includes a Device Motion Event. I've seen it run on an iPhone, and heard it is supported in Chrome Mac and used on the Google Jules Vern Doodle.
Is it supported in any other browser implementation yet? What versions did it become available in?
Supporting DeviceOrientation or DeviceMotion is a combination of the browser and the hardware it's running on. Both Firefox and Chrome on windows support DeviceOrientation in terms of having the API, but won't necessarily work on any particular hardware. Firefox supports DeviceMotion, but Chrome on windows doesn't.
On a lenovo thinkpad with 'lenovo airbag protection' running, Firefox 10 will provide DeviceMotion events, but strangely won't provide DeviceOrientation events. Also, the values it provides seem to be wrong (i.e. not measured in m/s/s). vAnd while Chrome has the DeviceOrientation API, I haven't been able to get it to provide events. Opera 11.61 on windows doesn't seem to support either API. Safari 5.1.2 for windows doesn't seem to support either.
An excellent page on using the DeviceMotionEvent is here http://www.html5rocks.com/en/tutorials/device/orientation/ which includes a demo using DeviceOrientation and another demo using DeviceMotion.

Debugging JavaScript in Internet Explorer and Safari

Currently, I don't really have a good method of debugging JavaScript in Internet Explorer and Safari. In Firefox, you can use Firebug's logging feature and command Line functions. However, this doesn't help me when I move to other browsers.
For Safari you need to enable the "Develop" menu via Preferences (in Safari 3.1; see the entry in Apple's Safari development FAQ) or via
$ defaults write com.apple.Safari IncludeDebugMenu 1
at the terminal in Mac OS X. Then from the Develop menu choose Show Web Inspector and click on the Console link. Your script can write to the console using window.console.log.
For Internet Explorer, Visual Studio is really the best script debugger but the Microsoft Script Debugger is okay if you don't have Visual Studio. This post on the IE team blog walks you through installing it and connecting to Internet Explorer.
Internet Explorer 8 looks like it will have a very fancy script debugger, so if you're feeling really adventurous you could install the Internet Explorer 8 beta and give that a whirl.
This is the Firebug Lite that #John was referring to that works on IE, Safari and Opera.
A post on the IE Blog, Scripting Debugging in Internet Explorer, explains different options for script debugging in Internet Explorer.
Here is the Apple Developer FAQ on debugging JavaScript in Safari.
Safari 3.0 and 3.1 include the Drosera JavaScript debugger, which you can enable on the Mac by following the instructions at that link. There's also the Safari Web Inspector..
Visual Studio 2005 has the Script Explorer (under the Debug > Windows menu). It shows a tree of all the scripted stuff that's currently debuggable. Previously I was breaking into the debugger via IE's View > Script Debugger menu, but I'm finding the Script Explorer is a quicker way to get to what I want.
The best method I've used for debugging JavaScript in Internet Explorer is through the Microsoft Script Editor. The debugger is full featured and very easy to use.
The article bellow teaches how to install the Microsoft Script Editor and configure it.
HOW-TO: Debug JavaScript in Internet Explorer
for Safari, sorry no answer...
Safari 3.1 doesn't need any magical commandline preferences -- the Advanced tab of the preferences window has an enable develop menu checkbox. That said if you can use the webkit nightlies (http://nightly.webkit.org), you're probably better off doing that as the developer tools are vastly improved, and you can more easily file bug reports requesting features that you want :D
See the Debugging chapter of the Safari User Guide for Web Developers for full documentation of how to debug in Safari. (For the most part it is the same API as Firebug.)
In IE you can use the IE Dev Tools, but I prefer Firebug Lite as others have mentioned.
There is now a Firebug Lite that works on other browsers such as Internet Explorer, Safari and Opera built. It does have a limited set of commands and is not as fully featured as the version in Firefox.
If you are using ASP.NET in Visual Studio 2008 will also debug JavaScript in Internet Explorer.

Categories

Resources