Is it possible to detect a HTML video playing on a browser? - html

I want to know if a html video is being displayed on a browser, from outside said browser, ideally without any plugins or such.
Motivation - I am trying to add this feature to Caffeine which is a Linux utility which disables the OS screensaver if, say, you are watching a movie.
The flash support was done I believe by detecting the presence of particular files or folders created by the plugin.
Ideally I would like 1 solution, but if I get 2 solutions for Firefox and Chrome, that's good enough.
p.s. Ultimately this would involve python code, but I am not sure if that is sufficient to make this question on-topic, or if this belongs on Superuser or Unix&Linux

This reminds me of something a web browser I was building in VB .Net which needed to detect if there where web pages that had tags like <a href="tel: or <a href="smsI know you said you didn't want a plugin but I would think you could easily right a browser plugin for for just this. In fact not exactly what your looking for but theirs a script monkey script called Hangouts Unlimited which prevents you from getting annoying messages asking if your still awake while in a G+ hangout. I don't know much about python but I would recomennd trying to identify the elements of the tags and when ever it finds such tags to disable the screen saver. Obviously the hangouts unlimited doesn't affect the web browser and that is most likely why you prefer not to have a browser plugin because you need to access system files outside of the browser. But I hope this helps a bit.

Related

Web browser interface using HTML/CSS/JS?

I’m building a simple browser, and I’d like to code most of it using HTML/JS/CSS. I cannot use iframes to display pages, due to frame-busting. What are my options?
The browser is not meant to be production-quality, but as a proof-of-concept for my thesis, similar to this interactive mockup. The main features it will need to support are:
Loading any page without frame-busting (even google.com),
Detecting when a link is clicked and opening it in a new frame, with the original one remaining intact.
I intend to write this using Web technologies, but it’s OK if it needs to be wrapped up in a small amount of something else, e.g., to turn it into an Android app. However, if it’s possible, it would be best if I could load the app as a web page. Finally, it is also preferable to be able to run the app on an Android device, but it’s OK if it only works on a desktop.
In researching this question, I came across a few options:
<iframe>. Google.com doesn't load at all in an iframe. I tried using the sandbox attribute, but it still didn’t load. Is there a way around this (for any page)?
Mozilla’s Browser API. This API was supposed to allow you to use the mozbrowser attribute in an iframe when building FirefoxOS apps. I suspect there’s no longer any way to access it. I couldn’t get the sample browser app loaded, and it seems that mozbrowser is not supported in WebExtensions. Did I miss something? Is there a way to make this work?
<webview> in a Chrome app. This is the only option that worked so far. I was able to download and install the sample browser app in Chrome. The one downside is that it seems to be Chrome-only (and I would prefer cross-platform or Firefox, all else being equal). Are there any issues with this option? Any way to make it run without Chrome?
Electron app with <webview>. While the setup here is more complicated than the previous option, it seems like the code would be very similar (there’s even a similar sample browser app). Are there any advantages/disadvantages to this option over the previous?
So, are there ways to make options 1 or 2 work? Are there perhaps other options?
HTML/CSS is a "language" translated by the browser into pages. You cannot code a browser in HTML. The easiest solution is to code it in C#.
I'm not sure if this is a good solution, but you can try Electron (nodeJS). You will only need to use JS/CSS/HTML.

HTML 5 Preventing Download

I am working a website, and I'm trying to prevent the video file to be downloadable.
I've already prevented the right click function, and I've used a webiste called http://htmlobfuscator.com/ that allows the source code to be very difficult to decipher. The only issue I now have remaining is the inspect element feature on browsers. Does anyone know of any way to prevent this? I know that someone is always going to find a way to download or capture a video, but I'm just trying to limit the spread of my videos.
Thanks for your help,
Stephen
There is no actually way of completely stopping someone, you could however as some have mentioned use something like Vimeo or YouTube to minimize the downloading of your videos, or another way you could do it and have found from personal experience is either creating a login/register on your site to make someone signup to get your video thus minimizing how many can download it or you can encrypt the video with a password, i believe Vimeo has this option which requires someone to enter a password in before even viewing the video.
Yet these are just two ways to Minimize not completely stop.
There is no way to stop a browser's document inspector from finding your file's location. However, I am a recording musician, and I know of a few things you can do to make thieving more difficult.
Put your JS video location in an external file. Not a lot of protection here, but worthwhile enough to add.
Break up the video location into a few different JS variables. Your thief would at least need some basic JavaScript knowledge to get to the video location.
Use an obfuscater, like you did. (I LOVE HTMLObfuscator!)
You could use flash video. This is difficult to download, but slower viewing, and also a bit more difficult to create and host on your website.
The best thing to use is streaming video, but not everyone is able to do that either.
Good luck!

Using a frameset for a web app

I am working on a web app consisting of 2 apps (one made by me, one 3rd party) residing side-by-side on one webpage. I have been using an iframe to embed the other app, but I want the size of the frame to be changed. Now, I could try going for a solution using javascript, but experience tells me, resizing in javascript is error-prone and inperformant. I am seriously considering to use a frameset in this case.
The arguments against frames I have seen so far do not apply to my case in the slightest, nobody wants to bookmark only a part of the page, the 3rd party app can be accessed externally anyways.
Now, I am wondering how bad the idea of using a frameset really is, I think I saw it being deprecated in the future, meaning support for it could be lost in near future? What other alternatives are there?

What are Chrome apps vs plugins vs extensions and how to develop them

I am trying to understand about Chrome (browser) development. I am very new to this and trying to figure out where to start in order to develop for Chrome Browser.
Just have a couple of questions:
What is the difference between Chrome Browser apps vs. plugins vs. extensions (not sure, if this question make sense. But, hope you got what I am asking for)
What kind of applications can I develop for Chrome Browser
What technologies do I need to learn in order to develop for Chrome Browser.
To answer your first question this explains the differences between apps and extensions (I think there's no better way to explain their nature):
https://developers.google.com/chrome/web-store/articles/apps_vs_extensions
What do you mean with "what kind of apps"?
You can develop both hosted and packaged apps if is that what you intended, give a look at this:
https://developers.google.com/chrome/apps/docs/index
Anyway the easiest way to start would be by building an extension, how-tos and
good documentation makes it good to start with:
http://developer.chrome.com/extensions/getstarted.html
Just to add to the above answer which was missing difference between Plugin and Extension is:
Plugin is a third-party library that is plugged-in to the browser and allows for being embedded on a webpage. It affects only the web page that is using the plugin.
Extensions change the browser UI, add menus or change overall look of the browser and can process each page that gets loaded.
So to sum it up - plugins add functionality and extra features to a particular webpage while extensions add functionality and features to the whole browser and change the behavior of the browser.
Just to add on new information since people may continue to hit this question: Chrome has basically deprecated plugins as of March 2017 (Chrome 57). If you go to chrome://plugins now, you won't see anything (you used to see a list of installed plugins with enable-disable links like for extensions).
It seems the reasoning is that the only plugins they actually wanted to allow you to enable/disable are Flash and PDF Viewer, both of which were moved to the Settings menus (if they weren't already there, not sure). The rest are considered to be integral parts of the browser. https://www.ghacks.net/2017/01/29/google-removes-plugin-controls-from-chrome/
Makes things a bit simpler to think about now.

What is the best way to upload a file via an HTTP POST with a web form?

Basically, something better than this:
<input type="file" name="myfile" size="50">
First of all, the browse button looks different on every browser. Unlike the submit button on a form, you have to come up with some hack-y way to style it.
Secondly, there's no progress indicator showing you how much of the file has uploaded. You usually have to implement some kind of client-side way to disable multiple submits (e.g. change the submit button to a disabled button showing "Form submitting... please wait.") or flash a giant warning.
Are there any good solutions to this that don't use Flash or Java?
Yaakov: That product looks to be exactly what I'm looking for, but the cost is $1000 and its specifically for ASP.NET. Are there any open source projects that cover the same or similar functionality?
File upload boxes is where we're currently at if you don't want to involve other technologies like Flash, Java or ActiveX.
With plain HTML you are pretty much limited to the experience you've described (no progress bar, double submits, etc). If you are willing to use some javascript, you can solve some of the problems by giving feedback that the upload is in progress and even showing the upload progress (it is a hack because you shouldn't have to do a full round-trip to the server and back, but at least it works).
If you are willing to use Flash (which is available pretty much anywhere and on many platforms), you can overcome pretty much all of these problems. A quick googling turned up two such components, both of them free and open source. I never used any of them, but they look good. BTW, Flash isn't without its problems either, for example when using the multi-file uploader for slide share, the browser kept constantly crashing on me :-(
Probably the best solution currently is to detect dynamically if the user has Flash, and if it's the case, give her the flash version of the uploader, while still making it possible to choose the basic HTML one.
HTH
You could have a look at the Fancy Upload script. Though it uses flash it still looks great.
The problem here is that the browsers specifically work to block anything that changes the basic file upload input control. You can't change it with javascript for instance.
The reason is security - if I could script it I could build a page that when you visited it sent me various files from your hard disk. Not nice.
There are various workarounds at the moment, but they're different between IE and FX (I don't know about Safari, Opera, etc).
Look at what http://www.gmail.com does in IE and FX when you attach something to an e-mail.
I want to see that rubbish "Browse" button - it tells me that I'm not letting anything unexpected in.
It is true, the file upload control is definitely behind the times. Hopefully this will be addressed in a future asp.net version.
Though it costs some money, I have found the Telerik upload control to have all of the functionality that you are looking for, including styling and progress updates (it also optimizes memory for large uploads).