Trouble with ActiveX objects in HTA - activex

I'm working on a chromeless HTA and found some code that allows you to minimize the window. It works fine when I run the HTA from a local drive, but when I put it on my network drive (so I can access it from another computer), it suddenly says the object doesn't support the Click property.
<script language="javascript">
function minWin(){
MyObj.Click();
}
</script>
<object Id="MyObj" CLASSID="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param NAME="command" VALUE="minimize">
</object>
This works fine when run locally, but the Click() property throws an error when the HTA runs from a network drive. Any idea why?

Related

Using input type="file" with ASP.Net and iPad and IIS's Windows Integrated Authentication

I'm trying to do a really basic, no-frills file upload on a boring old HTML page using input type="file" that posts to an .aspx page, both hosted on IIS (both IIS7 and IIS8) with Windows Integrated Authentication enabled (not anonymous). It works just fine on Chrome for desktop, but if I use either Chrome or Safari on iPad, I can sign in (to get past Windows Auth) and see the form, but if I pick a file and click Send, it just sits and spins. If I don't pick a file, it works fine. If I switch from Windows Auth to Anonymous Auth, it works fine, even on the iPad. The file I'm picking is just from the iPad's photo library (originally taken with the built-in camera), and when testing Chrome for desktop, I'm testing with the exact same file (which is tiny, 1.4M).
Here's the default.html:
<!doctype html>
<html>
<head>
<title>Upload Test</title>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="upload.aspx">
<input type="file" name="foo" />
<input type="submit" value="Send" />
</form>
</body>
</html>
upload.aspx:
<%# Page Language="C#" CodeBehind="upload.aspx.cs" Inherits="UploadTest.Upload" %>
upload.aspx.cs:
using System;
using System.Web.UI;
namespace UploadTest
{
public partial class Upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Response.ContentType = "text/plain";
this.Response.Write("Got here");
this.Response.End();
}
}
}
Notice I don't even try to access this.Request.Files in the above, although if I do, for instance:
var file = this.Request.Files["foo"];
this.Response.Write("Filename: " + (file == null ? "(no file)" : file.FileName));
...I do see the filename in the cases where it works.
I don't have a Web.config: I just copied bin, default.html, and upload.aspx into a test directory under C:\inetpub\wwwroot and then used IIS Manager to convert that to an application with default settings, and switch from Anonymous Auth to Windows Auth. (But this is an MCVE of a much more complex project that did have a Web.config, I've just been stripping things back to the bone to find the problem.)
To recap:
Works just fine in Chrome on desktop
Works just fine on iPad if I don't pick a file
Works just fine on iPad if I switch to Anonymous Auth instead of Windows Auth and do pick a file
Spins forever on iPad if I'm using Windows Auth and pick a file using either Chrome or Safari for iPad
I'm not a big ASP.net guy. What am I doing wrong? Some config switch I need to flip?
I switched to using the Kerberos Security Authentication Protocol rather than NTLM protocol and uploads started working for me.
As far as I can tell, this is a bug in iOS (!), and it's fixed in iOS 11.0. The exact same configuration that doesn't work with v10.3 works with v11.
Unfortunately, iOS 11.0 will only be made available for 5th gen onward, so we've had to work around this by reading the file via the File API and sending it in batches to the server as non-file data. Ugly workaround, but it was the only thing that worked.

MVC4 HTML5 video in IE10

I have tried everything I possibly could, but I was not able to solve this. I am trying to display an mp4 video using an HTML5 video element in IE9 and IE10. In IE9 I get a blank square where the video is supposed to show and in IE10 it says "Invalid Source". It plays fine in Chrome.
The video displays fine within a simple HTML file, but not in my ASP.net MVC project, whether run locally or on a web server. I have the file placed in my root folder (same folder as the web.config)
Here is my code in my ASP.NET MVC index.cshtml:
<video controls style="position:inherit" >
<source src="ExplainerVideo.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
</video>
Any ideas?
Thanks.
Try taking away the codec and letting the browser decide for itself whether it can play it or not.
e.g. <source src="ExplainerVideo.mp4" type='video/mp4' />
Failing that, try an absolute URL for the video as I've noticed this causing issues on IE before.

Why are images in SVGs not always loaded from the application cache when previously cached on the iPad?

We have a web application which allows users to view SVGs. These SVGs usually contain images which are loaded using a relative url. As we want this to be an iPad 'web app' we also want it to be added to the iPad user's homescreen and for it to be cached by the HTML 5 application cache so the user can view these SVGs and associated images offline.
When our application is loaded from the iPad home page icon, the application cache manifest is read correctly and all of the referenced resources are cached. The issue occurs when the user starts to use the application offline. During the use of the application, SVGs are added and removed from the page DOM. During this, some of the images in the SVG fail to be loaded from the application cache, even though they are definitely present and cached. Instead, a request for the image is made to the server, which obviously fails because the user is no longer online.
Interestingly enough, this issue doesn't seem to occur when navigating to a page in safari on the iPad. It seems to be specific to the full page web app view, although I can't guarantee it.
I can reproduce this quite easily using this HTML page:
<!DOCTYPE html>
<html manifest="testfiles.manifest">
<head>
<title>Test</title>
<script src="Javascript/jquery-1.7.1.js" type="text/javascript"></script>
<!-- Remove the browser chrome when the page is loaded from a homescreen icon -->
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>
<body>
<h1>Simple SVG caching test</h1>
<h2>Basket ball SVG</h2>
<p>
<span id="remove">Remove</span> | <span id="add">Add</span>
</p>
<p>
<span id="show">Show</span> | <span id="hide">Hide</span>
</p>
<p>
<span id="reload">Reload</span>
</p>
<embed width='360' height='510' src='TestFiles/Basketball.svg' />
<script type="text/javascript">
$(function ()
{
$("#remove").click(function ()
{
$("embed").remove();
});
$("#add").click(function ()
{
$("<embed width='360' height='510' src='TestFiles/Basketball.svg' />").appendTo("body");
});
$("#show").click(function ()
{
$("embed").show();
});
$("#hide").click(function ()
{
$("embed").hide();
});
$("#reload").click(function ()
{
location.reload(true);
});
})
</script>
</body>
</html>
This SVG:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="340"
height="340">
<image
width="340"
height="340"
xlink:href="Basketball.png"
x="0"
y="0" />
</svg>
This image which is referenced by the SVG:
And this manifest file:
CACHE MANIFEST
CACHE:
TestFiles/Basketball.svg
TestFiles/Basketball.png
Javascript/jquery-1.7.1.js
And by following these steps:
Open safari and navigate to the location of the reproduction html file (we host it on a Windows 2008 / IIS server)
Add the page to the home screen using the 'Add to Home Screen' button.
Close safari and clean out the safari cache
Load the page from the newly added bookmark
Wait until the page is completely cached. Usually about 5-10 secs, but you could attach to some application cache events to log out progress is desired.
Turn off wifi (or what ever means of connection you use)
Load the page from the newly added bookmark
Notice that the page looks correctly cached. Use the add and remove buttons. You should notice fairly quickly that when you add using the 'add' button on the page. The image resource in the SVG isn't always loaded from the application cache, even though it's clearly cached.
When the issue occurs, you should see something like the screen shot below
I've already checked some obvious things:
Application cache manifest has the correct mime type
Manifest is downloaded
Resources referenced in the manifest are cached correctly
My questions are:
Does anyone know why this happens?
Are there any workarounds to this issue?
I've logged this as a bug with apple, so I'll update this question with any feedback I may get from them!
Thanks!
Andy.
Just a small "head's up!" if you're pondering this issue, as I was until an hour ago...:
The manifest file is case-sensitive.
I have a website designed for use on both the desktop, tablets and smartphones. On Android (4.0.3) I noticed that after enabling the HTML 5 App Cache, my SVG icons started to fail, just as in your case above. They appear as broken links, when the user refreshes the page (and the icons are attempted fetched from the cache).
I had written a letter in the folder name to my SVG icons in the wrong case, and fixing this immediately fixed the issue.

How to fix the Runtime Error In server using jqueryMobile in MVC3?

I had develop a small jquery-mobile application in telerik MVC3. It is working in local machine and i uplod into my server and tested it works for desktop devices but when I test in Mobile (Iphone) it shows Error Like runtime Error
<!--web.config Cofiguration File-->
<configuration>
<system.Web>
<customErrors mode="Off"/>
</system.Web>
</configuration>
I can't understand why it showing only in mobile device please help me. How can I solve this error.
I think you can't see the error page due to the fact that JQueryMobile only shows a small popup with the message "Error loading page".
You can disable Ajax and this way see all html pages as a regular web app would.
Just add this script between Jquery and Jquery mobile script references
<script language="javascript" type="text/javascript">
$(document).bind("mobileinit", function () {
$.mobile.ajaxEnabled = false;
});
</script>

Phone Gap , Blackberry environment reference external JS file

I am using Phone Gap Blackberry environment for creating apps targeted OS6.0 & above.
In the index.html, inside the head tag i am referencing the external JS file, which actually contains the data needed for my application.
EG: www. google .com/js/data.js
In the project config.xml i have also referenced the the site
EG:< access subdomains="true" uri="http :// www.google.com" />
The issue here is, i dont see the data.js file being called. This works fine with Android & Iphone environment.
Am i doing something wrong here???
In your config.xml, you need to also provide access to the google.com domain, otherwise your app won't get access to google.com and won't be able to download the script file. From your post, it looks like you only provided access to nyigf.com.
You need to add an additional element to your config.xml, i.e.
<access subdomains="true" uri="http://www.google.com" />

Resources