Css3 Support for Hta

CSS3 support for HTA

HTAs not only support everything a webpage does—namely HTML, Cascading Style Sheets (CSS), scripting languages, and behaviors—but also HTA–specific functionality. This added functionality provides control over user interface design and access to the client system.

http://msdn.microsoft.com/en-us/library/ms536496(v=vs.85).aspx

Is there an HTA-like solution for modern web apps?

The good news, is that it does exist, but it's not as "out-of-the-box" as HTA.

My team has migrated from HTA to WebView2.

The overall approach is to build a program with the WebView2 browser (you're basically building your own HTA like browser). Your javascript code can communicate back and forth with the program, which in turn has full access to local resources.

WebView2 is the Microsoft Edge Chromium browser, so you're getting the latest web tech and layouts (a big pain for HTA dev.). The program that contains the WebView2 control has full access to local files, scales, printers (without a pop-up dialog).

The approach has all the benefits of HTA (html / javascript programming, local file access, web based deployment, etc.), plus all layout and other benefits of a modern browser.

The program you'll build is very small, especially compared with the HUGE runtime of similar solutions, like Electron.

Rick Strahl has an excellent article on WebView2, and tips for building the program I'm describing. He has great advice on how to build an installer for it, including "Evergreen", which keeps the WebView2 up-to-date with the latest browser tech.

Microsoft's introduction to the technology here.
https://learn.microsoft.com/en-us/microsoft-edge/webview2/

Rotate image in HTA

There is a way to do this:

<img src="example.png" width="214" height="236" style="filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1,mirror=1)"/>

In the rotation= property, 0 rotates the image 0°, 1 rotates the image 90° clockwise, 2 rotates the image 180° and 3 rotates the image 90° counter-clockwise.

In the mirror= property, 0 does not invert left and right and 1 inverts left and right.

Therefore, in the example above, an image that looks like this:

original image

will end up looking like this:

rotated image

Only whole numbers are permitted. This only works on IE6 and IE7, so if you want your code to be compatible with other browsers, add code that is compatible with other browsers.

hta - Equivalents in Firefox, Chrome - Is this old technology?

I'd say that .hta applications are way out of date since they don't support modern design standards. you can still use them or use another HTML Compilers like the one by David Esperalta, it's good enough for very simple apps, but they all depend on IE and we all know how limited and slow it is.

Modern Alternatives:

  • NW.js (previously known as node-webkit)
  • electron which I personally use and recommend.

both mentioned options are based on Chromium (same as Chrome), Node.js and V8. they support HTML5, CSS3 and latest JavaScript engine including latest ECMAScript features and beyond!

and since they use node.js you can use any of its built-in libraries (like FileSystem) or any of npm packages right in your DOM!

The npm registry hosts over a quarter million packages of reusable code — the largest code registry in the world.

both options are FREE and open sourced but electron supports ffmpeg codecs without downloading or building them.

  • both options now support ffmpeg out of the bag.

your app will be 100% standalone and you can build same app for Windows, macOS and Linux.

electron can also provide simple solutions to automatically compile and use CoffeeScript, Babel, LESS, SASS and more.

Downsides:

• You'll always have to ship the whole thing with you application since there's no run-time solution and you'll end up with a relatively big package.

• startup time is less than ideal for some applications

• although there is some methods to make it harder but your code will be available for anyone with an idea of what they are doing.



2021 Update

electron and nwjs are just as viable as ever but if you're looking for a more lightweight UI I'd also recommend Sciter.JS it made big leaps in recent updates and it does not ship a whole browser with your application, the developer seems committed to follow up-to-date HTML/CSS/JS Standards with some nice additions. it comes with good collections of samples to get you started. and prebuilt binaries for major OS editions.
one thing to note is that it uses QuickJS instead of Node.js if that matters to you.

I've been following its development closely and I recommend trying it.

object cannot support method .value in HTA on VDI

Problem was because body section was duplicated by accidentally copy-paste a piece of code.

Third Party HTML5 .HTA Application?

<meta http-equiv="x-ua-compatible" content="ie-edge">

This gives functionality of edge into a .HTA file.

Very handy!



Related Topics



Leave a reply



Submit