HTA apps in Windows 10 phone - windows-phone

Is HTA supposed to work on Windows 10 phones? It seems like it knows it's supposed to launch it, but something isn't right.
The HTA file that I tried to run, looks like this:
<html>
<head>
<meta charset="utf-8"/>
<title>Test HTA app</title>
<hta:application id="myApp"
applicationname="monster"
border="none"
caption="no"
showintaskbar="yes"
singleinstance="yes"
sysmenu="no"
windowstate="maximize">
</head>
<body>
<p>If you can read this, HTA works!</p>
</body>
</html>
And, before I tried to launch it, I went to Security > For developers, and set the Developer features to "Developer mode" instead of the original option "Windows Store apps".
Then I downloaded the HTA file, clicked on it from my Downloads app, and all I get is a message saying
LAUNCH FILE
Something went wrong. Could not launch the file.
Is there something I can do to make it work?
And just to avoid possibly having another question later; is Javascript going to work?

No, I believe HTA will not work for Windows Phone 10.
Edge (Windows phone 10's browser) does not support it.
See this link: https://connect.microsoft.com/IE/feedback/details/785055/hta-application-tag-does-not-work-in-ie10

Related

Download PDF file directly from external URL

I'm wondering if it's possible to download the PDF directly from another website's URL rather than opening a new window.
<button>Download FILE</button>
The most recommended way would be something like this
<!DOCTYPE html>
<html>
<body>
<h3>https://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml5_a_download</h3>
<p>Click on the image to download PDF32000_2008.pdf<p>
<a href="https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf" download><img src="https://www.w3schools.com/images/myw3schoolsimage.jpg" alt="PDF32000_2008 standard" width="104" height="142">
</a>
<p><b>Note:</b> The download attribute is not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).</p>
</body>
</html>
That is preferable to your method in that it lets the user decide the time of the download and rename document! Also you only need to serve a cover icon or image. HOWEVER although this works without any problems for me as a client user "offweb" it may not work same as any other link on a server if it is cross site tainted. The href address should only be for resources served on or via your own site.
and that should also be the case even if you use iFrame or any other hyper download method, without addressing Cross Origin issues.
Hence something like your current method is often touted as a "workaround" to bypass any Cross Site limitation, since the call for a fresh tab is a direct link from client browser to remote source thus not via "person in the middle" again HOWEVER, you should improve security by adding to it:-
<button>Download FILE</button>
<!DOCTYPE html>
<html>
<body>
<h3>https://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml5_a_download</h3>
<p>Click on the image to download PDF32000_2008.pdf<p>
<a href="https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf" rel="noopener noreferrer" target="_blank"><img src="https://www.w3schools.com/images/myw3schoolsimage.jpg" alt="PDF32000_2008 standard" width="104" height="142">
</a>
<p><b>Note:</b> The download attribute is not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).</p>
</body>
</html>
Note the snippet above was update to latest Adobe location and works as a file but here on Stack Overflow your browser may block the call !
The linked page gains partial access to the linking page via the window.opener object:- see https://stackoverflow.com/a/45902400/10802527 and https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

stream RTSP to HTML website

I would like to display IP cameras streaming in RTSP into a web page.
I've tried many solutions, like using VLC to transcode the stream, but none of them seems to be reliable enough to create a real web service.
I'm thinking on using some media server like flussonic or Red5. But I don't know if it will work.
This is why I would like to know what is the best (and the simple) solution to display RTSP streams on a webpage.
...to create a real web service.
I've been looking for an answer for the past two or three days (I need support on as many browsers as possible, and latency as low as possible, so WebRTC was the way to go (is there anything better?)) and I've finally found it.
Check out this repo.
From the repo's readme + the additional steps I had to take (on Ubuntu 18.04) to make this work:
Install go
$ sudo snap install go --classic
Get the code on your local device (Could someone enlighten me on what the export is for?).
$ export GO111MODULE=on
$ go get github.com/deepch/RTSPtoWebRTC
This step didn't work for me, so I just downloaded the code in a .zip file and extracted it in the given directory and proceeded. (What did I miss? The src directory was not there before I made it)
$ cd ~/go/src/github.com/deepch/RTSPtoWebRTC
Run from current directory.
$ go run .
Then I opened the link below a web browser ( I tested on Chrome, iOS Safari, but it also works on Firefox).
http://127.0.0.1:8083
This took me very little time to implement. Big thanks to the guys making this. All the other stuff I've found is either 5-7 years old and not working or non-WebRTC or a marketed paid service asking for unreasonable amounts of money.
I hope I answered your question.
After tried the "plugins" way suggested in
How can I display an RTSP video stream in a web page?
And the "conversion" way suggested in
https://www.npmjs.com/package/html5_rtsp_player
I finally found a really straight forward solution using this plugin, works for Chrome only which is ok for my project.
https://www.videoexpertsgroup.com/vxg-chrome-plugin/
This is how the html code look like
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8" />
<script type="text/javascript" src="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.js"></script>
<link href="/assets/vxgplayer-1.8.31/vxgplayer-1.8.31.min.css" rel="stylesheet" />
</head>
<body>
<div class="vxgplayer"
id="vxg_media_player1"
width="640"
height="480"
url="rtsp://admin:admin#192.168.1.117/defaultPrimary0?streamtype=u"
nmf-src="/assets/vxgplayer-1.8.31/pnacl/Release/media_player.nmf"
nmf-path="media_player.nmf"
useragent-prefix="MMP/3.0"
latency="10000"
autohide="2"
volume="0.7"
avsync
autostart
controls
mute
aspect-ratio
aspect-ratio-mode="1"
auto-reconnect
connection-timeout="5000"
connection-udp="0"
custom-digital-zoom></div>
</body>
</html>
You can integrate VLC library into your website and VLC will take care of everything you need for playing RTSP stream:
https://wiki.videolan.org/index.php?title=HowTo_Integrate_VLC_plugin_in_your_webpage&action=edit&oldid=19150

Unable to save specific file via dropbox saver

I am trying to save Visual Studio Community Edition 2015 from this url (http://download.microsoft.com/download/D/4/5/D4510E81-0900-425F-85F3-A09AFFADFA45/vs2015.rc_com_enu.iso) to my dropbox, using this code.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Saver</title>
<script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="MY-APP-KEY"></script>
</head>
<body>
Click here to save.
</body>
</html>
running on a local server. But this always returns the warning sign.
I tried with another file on some different domain and it worked. Can somebody point me to what I may be doing wrong?
Thanks.
If you set up the Dropbox Saver using JavaScript, you can implement an error callback that will give you more information in cases of failures like this.
I just did that with your link, and when doing that (after a good bit of time) I also see it fail, with the error message:
Job timed out
So, unfortunately, it seems the hosting serving is serving too slowly and/or the file is too big, making the save job take longer than the Dropbox Saver will allow.

How to test the google +1 button local

I am just creating an html file to test out the google +1 button. I guess the problem my html is not deployed on a server. How can you test the google+1 button on your local machine. This code doesn't render anything.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Google+1</title>
<!-- <link rel="stylesheet" href="css/main.css" type="text/css" /> -->
<script type=”text/javascript” src=”http://apis.google.com/js/plusone.js”></script>
</head>
<body >
<g:plusone></g:plusone>
</body>
</html>
I assume it can't be done because Google's API check the source of the request, otherwise many security holes would be exist.
Why won't you check it online? Just upload the site to it's domain and try to +1 from your account.
Another option for design purposes only: download an image of the +1 button and use it in the offline version.
You're probably just opening the HTML file locally. You can run the Google+ widgets on your local machine and will need to have internet access to load the external scripts. What you need to do is start up a web server and open the file from there. This is due to permissions for JavaScript required from the +1 code.
If you are on a Mac, you can do this either through the built-in Apache server (copy the file to /Library/WebServer/Documents and navigate to localhost/filename.html) or by spinning up a Python web server in the same folder as the file with the following command:
python -m SimpleHTTPServer 8000
After starting the Python web server, you can navigate to localhost port 8000.
If you are running on a Windows PC, you can find a number of web servers and install them, WAMP is a pretty simple option. Again, you would just install WAMP and then put your HTML file in the web/www folder that WAMP created and navigate there from localhost. You can also install Python and use the built-in web server as mentioned before.

Using Google Webfonts in Windows Phone 8 web browser control

I am trying to use web fonts in my Windows phone application. From the comments I have read, I understood that it is not possible to use fonts embedded into XAP file. So, I am trying to open a webpage that contains Google Web Fonts which is at: http://omercelik.com/e.htm
When I open this page from Internet Explorer on phone, it shows the font correctly. But when I try to load this page from a webBrowser control, it doesn't loads this page. I don't do anything else but this on my app:
private void PhoneApplicationPage_Loaded_1(object sender, RoutedEventArgs e)
{
webBrowser.Navigate(new Uri("http://omercelik.com/e.htm"));
}
So, still no success to show custom fonts in my application. There are suggestions to host font remotely and cache but even without caching, I couldn't show fonts. Can someone provide a working example of this?
It is possible to embed truetype fonts in Windows Phone 8 webapps by setting the embeddable tag on the font to 0 using software like TTFEdit. This might prove a more reliable and elegant solution to your problem.
See my answer to another Stack Overflow question here for all the details.
When using the WebBrowser control, it's very important to include the HTML doctype if you want to get proper IE10 behaviour (ie. not quirks mode) in Windows Phone 8...
<!DOCTYPE html>
<html>
<head>
<style>
#import url(http://fonts.googleapis.com/css?family=Tangerine);
</style>
</head>
<body>
<div id="para" style="font-family:'Tangerine', serif;">Making the Web Beautiful</div>
</body>
</html>
For future reference, Windows Phone 7's WebBrowser control (based on IE9) does not support Web Fonts.