My application is a local static website (e.g. to be accessed from a CD). Opening the page from a local machine and not a server causes IE to block the behaviour and displays this warning:

"Internet Explorer has restricted this web page from running scripts or ActiveX controls that could access your computer".

I am aware the "markoftheweb" hack to resolve this problem when running JavaScript locally, but this doesn't seem to be working for the PIE .htc behaviour. Any ideas (if there is fix) would be appreciated!

Otherwise, unfortunately this is a show-stopper for my application.

Tue Jul 20, 2010 2:03 pm

mark.t.macdonald

Joined: Tue Jul 20, 2010 1:54 pmPosts: 4

Re: Accessing from local machine triggers ActiveX warning

Managed to fix. "Mark of the Web" (MotW) lets you suppress the ActiveX warning if you apply it to both all HTML files that use PIE, and to the htc file itself:

MotW looks like this:<!-- saved from url=(0014)about:internet -->

In the HTML it goes immediately after the DOCTYPE.In PIE.htc it goes in the first line.In both cases, it must be followed by a carriage return and a line feed (PIE.htc needs to be converted to Windows-format EOL).

Rediculous that we have to apply extra hacks on top of our browser fixing hacks in IE!

Tue Jul 20, 2010 2:22 pm

jason

Joined: Wed Jul 14, 2010 11:46 amPosts: 1451

Re: Accessing from local machine triggers ActiveX warning

Interesting, I had not heard of this MotW thing before.

Is this something where we should include the MotW comment in the main distribution's PIE.htc file, so that individuals like yourself don't have to add it after the fact? Would it have any unwanted side-effects if it were always there?

Tue Jul 20, 2010 3:21 pm

mark.t.macdonald

Joined: Tue Jul 20, 2010 1:54 pmPosts: 4

Re: Accessing from local machine triggers ActiveX warning

I think that would be a good idea. If you decide to, you should also change the EOL (end of line) format to "windows style" (i.e. at the moment you have CR only, but it should be CR LF). I don't see there being any side effects because the .htc file only applies to IE/Windows anyway. It won't prevent the same .htc being served by a web server. All MotW does is tell IE to use the "Internet zone" security settings when opening a page from the local hard drive.

Suggestion for "known issues" page - heading called "static HTML pages opened from local machine or CD"Because, even if you add MotW to the PIE.htc file, people need to remember:

* to add MotW to all their HTML files* that PIE styles using relative URLs (likely for static websites on the local machine or a CD) need to be embedded in each HTML page, and not in a separate CSS file. If they in a separate CSS file and you try use relative URLs, i.e. throws an error: "Message: Access is denied." and PIE doesn't work.

Happy to help out more if you need with sample files or testing.

Tue Jul 20, 2010 3:46 pm

mark.t.macdonald

Joined: Tue Jul 20, 2010 1:54 pmPosts: 4

Re: Accessing from local machine triggers ActiveX warning

Incidentally, did you think about trying to make PIE in JavaScript? I don't know it it's possible, but .htc behaviours do seem like a somewhat ugly fix to an equally ugly problem!

Keep the good work up though - the concept is great and really helping my design now I've got it to work for local files.

Tue Jul 20, 2010 3:57 pm

jason

Joined: Wed Jul 14, 2010 11:46 amPosts: 1451

Re: Accessing from local machine triggers ActiveX warning

mark.t.macdonald wrote:

Incidentally, did you think about trying to make PIE in JavaScript? I don't know it it's possible, but .htc behaviours do seem like a somewhat ugly fix to an equally ugly problem!

Well, the behavior file itself is almost all JavaScript, plus a tiny bit of wrapper for hooking up events etc. I do plan at some point on reorganizing the code a bit so that the build can create a standalone .js file which authors could call manually. See http://github.com/lojjic/PIE/issues#issue/19. This would be in addition to the .htc, not in place of it, because .htc just has so many advantages over standalone JS: automatic attachment/detachment as elements are added/removed in the DOM, asynchronous loading, doesn't have to wait for DOMReady, etc.

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 3 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum