HTA的;使用其他浏览器托管?

时间:2022-11-19 09:54:23

If Microsoft's method for using IE as a local host for HTA's then, can I use any other browser instead?

如果微软的方法使用IE作为HTA的本地主机,那么我可以使用任何其他浏览器吗?

5 个解决方案

#1


11  

You can't.

你不能。

There is a similar Mozilla project named XULRunner, but HTA only works in Internet Explorer - the two technologies aren't compatible.

有一个名为XULRunner的类似Mozilla项目,但HTA仅适用于Internet Explorer - 这两种技术不兼容。

To make this clear: HTA will probably not work in anything that's not IE. Yes, HTA is a browser control in a window, but it also has normal aplication privileges (i.e. filesystem access, registry, arbirary code execution etc.). When running in a browser, these privileges are denied (for good reasons - you don't want just any webpage to read your files).

为了明确这一点:HTA可能不适用于任何不是IE的东西。是的,HTA是窗口中的浏览器控件,但它也具有正常的应用程序权限(即文件系统访问,注册表,arbirary代码执行等)。在浏览器中运行时,这些权限被拒绝(出于好的理由 - 您不希望任何网页只读取您的文件)。

So, launching the HTA in a browser will work, but any interaction with the local system will fail, which negates the whole idea. Launching a HTA in XULRunner will also fail, because XULRunner uses a completely different API.

因此,在浏览器中启动HTA将起作用,但是与本地系统的任何交互都将失败,这会否定整个想法。在XULRunner中启动HTA也会失败,因为XULRunner使用完全不同的API。

The only scenario that could possibly work is this: a webapp which doesn't use any of the HTA-specific or XULRunner-specific API (i.e. behaves like a normal browser app). In such case, your app might work with HTA, XULRunner, as well as in any browser. Incidentally, this would take away any advantage of using HTA and introduce masive security holes because of the higher privileges; you'd be better off with using Google Chrome or Mozilla Prism for that.

唯一可行的方案是:一个不使用任何特定于HTA或特定于XULRunner的API的webapp(即行为类似于普通的浏览器应用程序)。在这种情况下,您的应用程序可能适用于HTA,XULRunner以及任何浏览器。顺便说一下,由于更高的特权,这将消除使用HTA的任何优势并引入主要的安全漏洞;你最好使用Google Chrome或Mozilla Prism。

(We've been trying to find a cross-browser solution for some time, and HTA is definitely not it)

(我们一直试图找到一个跨浏览器的解决方案,HTA绝对不是它)

#2


7  

I was tackling the related task of running hta's from various browsers. I've put my findings here for anybody else who is trying to do that and finds this question.

我正在处理从各种浏览器运行hta的相关任务。我把我的研究结果发给了其他试图做到这一点并发现这个问题的人。

You can run hta's from several browsers, using the same mshta executable that IE uses. You need fully qualified URI's in your hta code, which isn't needed from IE.

您可以使用IE使用的相同mshta可执行文件从多个浏览器运行hta。您需要在您的hta代码中使用完全限定的URI,这在IE中是不需要的。

Today (2011-02-01) I tried using hta's from Firefox (3.6.13), Opera 11 and Safari for Windows 5.0.3.

今天(2011-02-01)我尝试使用Firefox(3.6.13),Opera 11和Safari for Windows 5.0.3中的hta。

After some teething problems in Firefox I got hta's to work from those browsers. (In all cases these use the same mshta executable that IE uses. This is not hta's running in other browsers, but running hta's from other browsers. This might suit your purposes.)

在Firefox出现一些问题后,我得到了那些浏览器的工作。 (在所有情况下,这些都使用与IE相同的mshta可执行文件。这不是hta在其他浏览器中运行,而是从其他浏览器运行hta。这可能适合您的目的。)

The hta started desktop applications on my machine (as it does from IE).

hta在我的机器上启动了桌面应用程序(就像IE一样)。

The experience wasn't perfect. For IE I set root relative paths in the hta. For the other browsers you can't do that. You need to set fully qualified URI's for things like images, referenced hta's and icons.

经验并不完美。对于IE,我在hta中设置了根相对路径。对于其他浏览器,您无法做到这一点。您需要为图像,引用的hta和图标等设置完全限定的URI。

So after a little editing I have the hta's working from 4 browsers (IE 8, FF 3, Opera 11 and Safari 5 (Windows)).

因此,经过一些编辑后,我得到了4个浏览器(IE 8,FF 3,Opera 11和Safari 5(Windows))的hta工作。

(Quick snapshot of that. I'm running hta's from a web server on the local machine. (I have no plans to run them from remote sites.) This allows my workflow to go from browser to desktop more smoothly. The hta's fire up local applications that do things like edit web pages (including the hta's themselves), validate those pages and fire up IDE's. Bridging the gap between browser and desktop apps. has been a liberating experience. I recommend it!)

(快速快照。我正在从本地机器上的Web服务器运行hta。(我没有计划从远程站点运行它们。)这使我的工作流程能够更顺畅地从浏览器转移到桌面.hta的启动本地应用程序,用于编辑网页(包括hta本身),验证这些页面并启动IDE。缩小浏览器和桌面应用程序之间的差距。这是一种解放的体验。我推荐它!)

Notes:

笔记:

  1. The Firefox development team have notes about enabling hta's which encouraged me to continue after initial failure.
  2. Firefox开发团队有关于启用hta的注释,这鼓励我在最初失败后继续。
  3. To achieve this in Firefox configuration I set HTML applications to run under mshta.exe (called Microsoft HTML Application Host, in the combo box). Initially that didn't work. I selected "other" picked the same application by hand. That worked, though I have two identical looking entries! You need mshta.exe on your machine to run for any browser. I assume the normal way to install mshta is with IE. (mshta is essentially a modified version of IE, possibly not the current version!)
  4. 为了在Firefox配置中实现这一点,我将HTML应用程序设置为在mshta.exe(在组合框中称为Microsoft HTML Application Host)下运行。最初那不起作用。我选择“其他”手工挑选相同的应用程序。虽然我有两个完全相同的条目,但这很有用!您的计算机上需要mshta.exe才能运行任何浏览器。我假设安装mshta的正常方法是使用IE。 (mshta本质上是IE的修改版本,可能不是当前版本!)
  5. The Firefox developers have marked this as a strategic effort to dislodge IE from the Enterprise. Their implementation (and Opera's) force you to use fully qualified URI's but apart from that the hta's work as expected.
  6. Firefox开发人员将此标记为将IE从企业中移除的战略性努力。它们的实现(和Opera的)强制你使用完全限定的URI,但除此之外,hta的工作正如预期的那样。
  7. Firefox seems to cache old versions of the hta's, and doesn't download new ones, though it appears to download something! You might need to clear the cache during development.
  8. Firefox似乎缓存旧版本的hta,并没有下载新版本,虽然它似乎下载了一些东西!您可能需要在开发期间清除缓存。
  9. My first attempt to do it with Chrome was not successful. Further investigation suggests Chrome doesn't have a native interface for invoking other processes, based on their file extension.
  10. 我第一次尝试使用Chrome并没有成功。进一步的调查显示,Chrome没有基于文件扩展名调用其他进程的本机界面。

#3


2  

It isn't so much that IE hosts anything, but that mshta.exe hosts components it shares with IE. MSHTA is a script host, much as CScript and WScript are. While IE is also a script host (in the strictest sense) its primary purpose is to be a Web browser.

它不是IE托管任何东西,而是mshta.exe托管它与IE共享的组件。 MSHTA是一个脚本宿主,就像CScript和WScript一样。虽然IE也是一个脚本主机(严格意义上说),但它的主要目的是成为一个Web浏览器。

The Mozilla project mentioned previously is the closest alternative I have found that is based on a browser's innards.

之前提到的Mozilla项目是我发现的最接近的替代方案,它基于浏览器的内部结构。

Other script hosts exist for windows too. One of these is NS Basic/Desktop but it is based on standard Windows controls, not browser rendering and an HTML DOM.

Windows也存在其他脚本宿主。其中一个是NS Basic / Desktop,但它基于标准的Windows控件,而不是浏览器呈现和HTML DOM。

#4


1  

Just to be clear: It is not IE nor MSHTMA that really renders a webpage. The rendering thing is partly build into the OS. Thus, things like Active Desktop (does anybody remember that XP thing?) or .HTA or .CHM work without IE. It's just the same way to recognise some HTML things.

需要明确的是:真正呈现网页的不是IE也不是MSHTMA。渲染事物部分构建到操作系统中。因此,像Active Desktop这样的东西(有人记得XP的东西吗?)或.HTA或.CHM没有IE工作。这与识别某些HTML内容的方式相同。

#5


0  

I believe Internet Explorer's hosting of HTA apps works because their HTA host is registered to handle the extension. If this is indeed the case then in theroy another host could be used

我相信Internet Explorer托管HTA应用程序是有效的,因为他们的HTA主机已注册处理扩展。如果情况确实如此,那么在理论中可以使用另一个主机

For the sake of completeness I should note that I am not expeirienced in the development of HTA applications and am basing my response on my understanding of the Windows OS

为了完整起见,我应该注意到我并不是在开发HTA应用程序方面经验丰富,而是基于我对Windows操作系统的理解。

#1


11  

You can't.

你不能。

There is a similar Mozilla project named XULRunner, but HTA only works in Internet Explorer - the two technologies aren't compatible.

有一个名为XULRunner的类似Mozilla项目,但HTA仅适用于Internet Explorer - 这两种技术不兼容。

To make this clear: HTA will probably not work in anything that's not IE. Yes, HTA is a browser control in a window, but it also has normal aplication privileges (i.e. filesystem access, registry, arbirary code execution etc.). When running in a browser, these privileges are denied (for good reasons - you don't want just any webpage to read your files).

为了明确这一点:HTA可能不适用于任何不是IE的东西。是的,HTA是窗口中的浏览器控件,但它也具有正常的应用程序权限(即文件系统访问,注册表,arbirary代码执行等)。在浏览器中运行时,这些权限被拒绝(出于好的理由 - 您不希望任何网页只读取您的文件)。

So, launching the HTA in a browser will work, but any interaction with the local system will fail, which negates the whole idea. Launching a HTA in XULRunner will also fail, because XULRunner uses a completely different API.

因此,在浏览器中启动HTA将起作用,但是与本地系统的任何交互都将失败,这会否定整个想法。在XULRunner中启动HTA也会失败,因为XULRunner使用完全不同的API。

The only scenario that could possibly work is this: a webapp which doesn't use any of the HTA-specific or XULRunner-specific API (i.e. behaves like a normal browser app). In such case, your app might work with HTA, XULRunner, as well as in any browser. Incidentally, this would take away any advantage of using HTA and introduce masive security holes because of the higher privileges; you'd be better off with using Google Chrome or Mozilla Prism for that.

唯一可行的方案是:一个不使用任何特定于HTA或特定于XULRunner的API的webapp(即行为类似于普通的浏览器应用程序)。在这种情况下,您的应用程序可能适用于HTA,XULRunner以及任何浏览器。顺便说一下,由于更高的特权,这将消除使用HTA的任何优势并引入主要的安全漏洞;你最好使用Google Chrome或Mozilla Prism。

(We've been trying to find a cross-browser solution for some time, and HTA is definitely not it)

(我们一直试图找到一个跨浏览器的解决方案,HTA绝对不是它)

#2


7  

I was tackling the related task of running hta's from various browsers. I've put my findings here for anybody else who is trying to do that and finds this question.

我正在处理从各种浏览器运行hta的相关任务。我把我的研究结果发给了其他试图做到这一点并发现这个问题的人。

You can run hta's from several browsers, using the same mshta executable that IE uses. You need fully qualified URI's in your hta code, which isn't needed from IE.

您可以使用IE使用的相同mshta可执行文件从多个浏览器运行hta。您需要在您的hta代码中使用完全限定的URI,这在IE中是不需要的。

Today (2011-02-01) I tried using hta's from Firefox (3.6.13), Opera 11 and Safari for Windows 5.0.3.

今天(2011-02-01)我尝试使用Firefox(3.6.13),Opera 11和Safari for Windows 5.0.3中的hta。

After some teething problems in Firefox I got hta's to work from those browsers. (In all cases these use the same mshta executable that IE uses. This is not hta's running in other browsers, but running hta's from other browsers. This might suit your purposes.)

在Firefox出现一些问题后,我得到了那些浏览器的工作。 (在所有情况下,这些都使用与IE相同的mshta可执行文件。这不是hta在其他浏览器中运行,而是从其他浏览器运行hta。这可能适合您的目的。)

The hta started desktop applications on my machine (as it does from IE).

hta在我的机器上启动了桌面应用程序(就像IE一样)。

The experience wasn't perfect. For IE I set root relative paths in the hta. For the other browsers you can't do that. You need to set fully qualified URI's for things like images, referenced hta's and icons.

经验并不完美。对于IE,我在hta中设置了根相对路径。对于其他浏览器,您无法做到这一点。您需要为图像,引用的hta和图标等设置完全限定的URI。

So after a little editing I have the hta's working from 4 browsers (IE 8, FF 3, Opera 11 and Safari 5 (Windows)).

因此,经过一些编辑后,我得到了4个浏览器(IE 8,FF 3,Opera 11和Safari 5(Windows))的hta工作。

(Quick snapshot of that. I'm running hta's from a web server on the local machine. (I have no plans to run them from remote sites.) This allows my workflow to go from browser to desktop more smoothly. The hta's fire up local applications that do things like edit web pages (including the hta's themselves), validate those pages and fire up IDE's. Bridging the gap between browser and desktop apps. has been a liberating experience. I recommend it!)

(快速快照。我正在从本地机器上的Web服务器运行hta。(我没有计划从远程站点运行它们。)这使我的工作流程能够更顺畅地从浏览器转移到桌面.hta的启动本地应用程序,用于编辑网页(包括hta本身),验证这些页面并启动IDE。缩小浏览器和桌面应用程序之间的差距。这是一种解放的体验。我推荐它!)

Notes:

笔记:

  1. The Firefox development team have notes about enabling hta's which encouraged me to continue after initial failure.
  2. Firefox开发团队有关于启用hta的注释,这鼓励我在最初失败后继续。
  3. To achieve this in Firefox configuration I set HTML applications to run under mshta.exe (called Microsoft HTML Application Host, in the combo box). Initially that didn't work. I selected "other" picked the same application by hand. That worked, though I have two identical looking entries! You need mshta.exe on your machine to run for any browser. I assume the normal way to install mshta is with IE. (mshta is essentially a modified version of IE, possibly not the current version!)
  4. 为了在Firefox配置中实现这一点,我将HTML应用程序设置为在mshta.exe(在组合框中称为Microsoft HTML Application Host)下运行。最初那不起作用。我选择“其他”手工挑选相同的应用程序。虽然我有两个完全相同的条目,但这很有用!您的计算机上需要mshta.exe才能运行任何浏览器。我假设安装mshta的正常方法是使用IE。 (mshta本质上是IE的修改版本,可能不是当前版本!)
  5. The Firefox developers have marked this as a strategic effort to dislodge IE from the Enterprise. Their implementation (and Opera's) force you to use fully qualified URI's but apart from that the hta's work as expected.
  6. Firefox开发人员将此标记为将IE从企业中移除的战略性努力。它们的实现(和Opera的)强制你使用完全限定的URI,但除此之外,hta的工作正如预期的那样。
  7. Firefox seems to cache old versions of the hta's, and doesn't download new ones, though it appears to download something! You might need to clear the cache during development.
  8. Firefox似乎缓存旧版本的hta,并没有下载新版本,虽然它似乎下载了一些东西!您可能需要在开发期间清除缓存。
  9. My first attempt to do it with Chrome was not successful. Further investigation suggests Chrome doesn't have a native interface for invoking other processes, based on their file extension.
  10. 我第一次尝试使用Chrome并没有成功。进一步的调查显示,Chrome没有基于文件扩展名调用其他进程的本机界面。

#3


2  

It isn't so much that IE hosts anything, but that mshta.exe hosts components it shares with IE. MSHTA is a script host, much as CScript and WScript are. While IE is also a script host (in the strictest sense) its primary purpose is to be a Web browser.

它不是IE托管任何东西,而是mshta.exe托管它与IE共享的组件。 MSHTA是一个脚本宿主,就像CScript和WScript一样。虽然IE也是一个脚本主机(严格意义上说),但它的主要目的是成为一个Web浏览器。

The Mozilla project mentioned previously is the closest alternative I have found that is based on a browser's innards.

之前提到的Mozilla项目是我发现的最接近的替代方案,它基于浏览器的内部结构。

Other script hosts exist for windows too. One of these is NS Basic/Desktop but it is based on standard Windows controls, not browser rendering and an HTML DOM.

Windows也存在其他脚本宿主。其中一个是NS Basic / Desktop,但它基于标准的Windows控件,而不是浏览器呈现和HTML DOM。

#4


1  

Just to be clear: It is not IE nor MSHTMA that really renders a webpage. The rendering thing is partly build into the OS. Thus, things like Active Desktop (does anybody remember that XP thing?) or .HTA or .CHM work without IE. It's just the same way to recognise some HTML things.

需要明确的是:真正呈现网页的不是IE也不是MSHTMA。渲染事物部分构建到操作系统中。因此,像Active Desktop这样的东西(有人记得XP的东西吗?)或.HTA或.CHM没有IE工作。这与识别某些HTML内容的方式相同。

#5


0  

I believe Internet Explorer's hosting of HTA apps works because their HTA host is registered to handle the extension. If this is indeed the case then in theroy another host could be used

我相信Internet Explorer托管HTA应用程序是有效的,因为他们的HTA主机已注册处理扩展。如果情况确实如此,那么在理论中可以使用另一个主机

For the sake of completeness I should note that I am not expeirienced in the development of HTA applications and am basing my response on my understanding of the Windows OS

为了完整起见,我应该注意到我并不是在开发HTA应用程序方面经验丰富,而是基于我对Windows操作系统的理解。