Forums
View unanswered posts | View active topics It is currently Wed Jul 23, 2014 10:22 pm



Reply to topic  [ 6 posts ] 
 Accessing from local machine triggers ActiveX warning 
Author Message

Joined: Tue Jul 20, 2010 1:54 pm
Posts: 4
Post Accessing from local machine triggers ActiveX warning
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
Profile

Joined: Tue Jul 20, 2010 1:54 pm
Posts: 4
Post 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).

More info:

MotW Instructions (General)
http://msdn.microsoft.com/en-us/library/ms537628(VS.85).aspx

Tricks with MotW to get .htc bevahiours also working
http://blogs.msdn.com/b/adioltean/archi ... 60120.aspx

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


Tue Jul 20, 2010 2:22 pm
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1441
Post 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
Profile

Joined: Tue Jul 20, 2010 1:54 pm
Posts: 4
Post 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
Profile

Joined: Tue Jul 20, 2010 1:54 pm
Posts: 4
Post 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
Profile

Joined: Wed Jul 14, 2010 11:46 am
Posts: 1441
Post 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.


Tue Jul 20, 2010 5:05 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot] and 5 guests


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.