external CSS not honored in HTA popup

2.2k Views Asked by At

This problem is killing me. Searched the web for 2 days now and beginning to feel like I'm the only one who's experiencing this issue (???). Here's the problem:

A simple HTA that uses CSS3 rule to format background. The rule is in an external .css file that is being included in both the main and a child HTA files:

common.css

body{
  background-image:
    -ms-radial-gradient(top, circle cover, #3c3b52 0%, #252233 80%);
  color: rgba(255,255,255,0.6);
}

main.hta

<html>
<head>
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <HTA:application id="main" applicationName="CSS3 HTA" />

    <link rel="stylesheet" type="text/css" href="common.css" />
</head>
<body>
    <p>Click the button to pop a new window up</p>
    <button onclick="window.showModelessDialog('child.hta');">
        popup window
    </button>
</body>
</html>

child.hta

<html>
<head>
    <meta http-equiv="x-ua-compatible" content="IE=edge" />
    <HTA:application id="child" applicationName="CSS3 HTA (popup)" />

    <link rel="stylesheet" type="text/css" href="common.css" />
</head>
<body>
    Hello, world! Where's my CSS3 background?!?
</body>
</html>

Running the child.hta on its own as a standalone app shows the (proper) CSS3 background as specified in the rules. But when opening it as a child modeless dialog box (or modal) the CSS rules are not honored (any CSS rules, versions 1.0, 2.0, 2.1, 3.0).

I'm using

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

and having no luck at all (also tried with "IE=9" option - same negative result).

Does anyone know how to make this work? How to make the common.css properly apply to an HTA's pop-up window?

Than you for your time

UPDATE

Though this is not strictly speaking an answer to the question but this works for what I need (an independent window running some extra functionality):

<button onclick="(new ActiveXObject('WScript.Shell')).Run('child.hta', 1)">
    new HTA window
</button>

Essentially instead of popping up a dialog window the code is launching an instance of HTA. And then the full "new IE" support is back.
Although that seems to bring a new issue - that launched HTA doesn't honor the singleInstance="yes" directive! /shake-fist-at-MS

0

There are 0 best solutions below