How protect this link? - javascript

I want to hide HTML Code from source code, how this is possible?
For example:
jwplayer("mediaplayer").setup({
file: "http://example.com/Media.m3u8",
autostart: 'true',
controlbar: 'bottom',
file: "http://example.com/Media.m3u8", How can I hide the code?

You can't hide it, the best you could do is make it a little harder to figure it out. And this is just obscuring, it is NOT securing.
For the server side portion, you could change:
file: "http://example.com/Media.m3u8",
to
file: window.atob('<?php echo base64_encode("http://example.com/Media.m3u8");?>'),
and then the output will be:
file: window.atob('aHR0cDovL2V4YW1wbGUuY29tL01lZGlhLm0zdTg='),
Just know, this won't stop anyone who really wants to figure it out. It will only stop someone who doesn't know anything about programming and is too lazy to spend five minutes on it.

You can't. It has to be sent to the browser in order to be executed/viewed/played, and the user can always copy it.

You can not handle it, but on the other side, that the link you provided, you can manage the authentication

If your question is how to protect the link, you can use some server side code to generate a one time usable link generated each time the page is loaded that only allows access to that file one time. once that use is up the URL is now useless. But even this is able to be bypassed.

It is not possible to totally hide something. At the end of the day, if people want to take your content badly enough, they will figure out a way to do so.
However, if you want to use HLS AES encryption, or secure streaming via RTMPE, that will help. The JW Player supports both of these. Then you can also use some tools to encode/encrypt/obfuscate your code, however, people with any technical know how can easily decode/decrypt/deobfuscate this with other tools, or simply by using Firebug/Chrome developer tools. It will make it harder for some of your audience to take your videos, though, but not all. But people will still be able to figure out a way to do this if they want your content badly enough, they will even use screen recorders as a last resort. One other thing you should do is encode your videos with your own watermark if you are concerned about people screen recording your videos.

My idea would be to look into only allowing your site (domain name) to download it and encoding the link.

Related

How to change language of website if url ends with "lang=fr"

Let's say I have a page with the URL www.page.com/default.aspx?lang=fr.
Is there a way to change the content's language with JavaScript by looking at the URL?
Of course it's possible, but potentially complex and definitely not advisable. Besides needing a script that dynamically changes the text of each element on the page, you'd need to provide the french resources on the client in the first place, as well as all other languages you intend to support. For everything but the most simple pages this would be a huge and unmaintainable mess.
This is better done on the server using Resources:
http://msdn.microsoft.com/en-us/library/ms227427.aspx
I am new to javascript ,but I think it's not so difficult to solve this question:
var specifyLang='yourLang';//define your page language
var temp=location.protocol+'//'+location.host+location.pathname+'?lang='+specifyLang;//cpmplete the new URL
location=temp;
location.reload(true);//refresh the page from server
maybe it's not prefect ,but solve your problem at least...

Emailing parts of a formatted webpage

I'm trying to create a button on my webpage that, when clicked, embeds a particular div into an email and sends it out. I want the email's look and feel to be exactly like the webpage (minus the Javascript of course). That is, it should resemble the behavior of clicking file>share>email in Safari, except that I only want parts of the page and not the entire thing.
Is there any easy way to do this? Your help is very much appreciated.
Update:
So I ended up using AJAX to invoke a PHP script to do this, with the help of this library: http://pear.php.net/package/Mail_Mime
Still struggling with the CSS, but it looks pretty promising so far.
It sounds like you want to be able to have the browser talk to the user's email client (i.e., click on mailto:test#test.com and have this bit of HTML appear in the email client ready to be sent off). That won't happen with a regular browser and javascript, because the window doesn't know anything about what other programs are available or in use on the user's machine. You'll need to send the HTML to the server and have the server send the email. Also, I've been told that CSS styling for email is very difficult, so having the 'look and feel be exactly like the webpage' is going to be tougher than you probably think.
All that said, it is very doable. You just need to focus your effort on getting the HTML to the server and then deciding what library to use to send the email (depends on the language). That's only half the battle, though, as you'll need to work just as hard to style it and test it on a variety of email clients (I assume). I've never done CSS for email before, but I'm pretty sure that's what's generally involved.

Display Comic Book files on a webpage?

I'm thinking about creating a webpage and I'm trying to brainstorm some ways to display them in the page.
If i wanted to get dirty and create everything myself, i think i could do it with html5, CSS3, and javascript/jquery. Just do some kind of page buttons with an image tag and maybe get into some more detailed stuff as it comes up (i dont know how i would do zooming and multiple pages).
But wahat i really want to know is if there is already some way to do this? I've looked around for a bit and cant seem to find any sort of plugin that would read a cbz file or display an set of images with the 'e-reader' type of tools in mind. Just wondering if anyone knows of anything?
Thanks
I used to use an online reader for a long time so I started an experiment to build one myself a while back: netcomix
It's open source so you can see if you find anything appealing in what I did. I figured I'd do all the real UI work client side with HTML, CSS, and JavaScript and the server was strictly responsible for acting as a service (for example, to supply a list of comics or a list of all the pages in a particular issue) and serving up the individual JPG/PNG/GIF files. That compartmentalized things nicely and I was very pleased with how jQuery BBQ gave me a history that I could back through even though I stayed on one page the whole time.
Now if I were to do the same experiment again, I'd use Backbone.js to give some structure to the client side and obviously it needs a lot of love because the server side really does nothing at the moment. Early versions were strictly hard coded although I started putting in some simple SQL stuff in there in the latest version. It's nothing more than an experiment though and should be treated as such. It's there for ideas and little else. If you find it interesting and want some more ideas contact me and I'll be happy to let you know all my wacky ideas for such a program.
I know this is an old question. But web technologies have gotten better in the last few years. There are several comic book readers that can work in the browser using pure HTML and JavaScript. I wrote one called: http://comic-book-reader.com .
If you want to see a very simple example of how to read CBR and CBZ files in the browser. You should check out http://workhorsy.github.io/uncompress.js/examples/simple/index.html which uses the JavaScript library https://github.com/workhorsy/uncompress.js

What's the best way of stopping users from copying and pasting text from a web app?

The site I'm working on displays some proprietary 3rd party data that's quite valuable. As such they want to stop people copying and pasting their information. They understand that, of course, there's nothing we can do to stop users just writing down info or printing it off, but they want to make it as difficult as possible for their data to be taken. The other big concern is performance. The site sees a healthy amount of activity, so keeping it snappy is a big deal.
I was hoping to get a bit of feedback from you guys on the best way of accomplishing this
Some potential solutions that have been suggested:
Use a bit of javascript to stop users hitting ctrl / right clicking (irritating and won't stop more advanced users)
Use flex (very slow, but very safe since the data is binary)
Create or find some funky html to image converter and display the data as images
Your thoughts and opinions are very welcome.
Thanks in advance!
Charge the users for access to the information.
You can try all sorts of code workarounds, but you really aren't going to stop anyone who is determined. By charging, you limit access to people who really need the information and if they copy it, then at least you've been reimbursed. It also filters out a lot of the people who would use it maliciously. Also, put a legal notice on the information detailing how it can be used so that you can follow up copiers with legal action if necessary.
This really sounds like a serious problem with the origins of the question. If this is something that shouldn't be easy to copy, why is it visible at all?
If its really proprietary, why is it a good idea to post it on the web?
Seems that an internal webpage would be more appropriate.
It is a tricky situation, since this is the web...
You could use a very small bit of flash to display the sensitive data, which you'd have complete control over, and if it's small, shouldn't hurt your download times. This would probably be my preferred method.
Option #3 would stop people from copying and pasting, but it wouldn't stop them from downloading the image. I'm not sure if that matters to you.
Do you need to serve audiences that have javascript turned off? If not, you could use AJAX to pull the sensitive information in the first place, then use a script to stop them from copying that div or whatever.
You might want to check out Tynt Tracer. It doesn't prevent copying, but at least allows you to track where it's going...in part anyway.
You might look at the option 1, as a "bare minimum" way of doing it, but admittedly it isn't a great option, as simply disabling JS gets around it.
Your third idea would also work, but you can actually make it easier to save by going to the image and the way they are stored in temporary internet files.
Also, as a side note, to prevent printing you might want to specify a print only CSS that hides all content.
body {display:none;}
It isn't perfect, but again stops the casual user from printing.
Charging money for the content is a good answer, but I'm guessing you're already charging for the content.
#2 is clearly the most secure option, and the most flexible, allowing you to really punish yourself as much as possible as well (do things like implement over the wire encryption etc...) So it should come as no surprise it is also the most expensive to implement.
Given, someone can just decompile your code and inspect memory, but at that point, it is doubtful you are going to stop anyone.
Offer the information for download in password protected pdf, where the only thing that they can do is to view it, no printing, copy paste, etc. Although you can't stop a print screen. Primo PDF can do that for you and is free. http://www.primopdf.com/
They key here is the that effort it takes to bypass any solution you choose, is greater than the value of the information you are trying to protect from being copied.

How to take a screen shot of a web page?

I want to add a button to one of our web sites that will allow the user to file a bug with our bug tracking system.
One of the feature requests is that a screen cap of the page in question be sent along.
Without installing something on the end users machine, how can I do this? Does javascript have some sort of screen cap api?
You may grab the innerHTML of the page and then process it on the server:
document.getElementsByTagName('html')[0].innerHTML;
// this would also be interactive (i.e. if you've
// modified the DOM, that would be included)
No, javascript does not have anything like this.
I'm afraid that this will be quite hard. I can not think anything that would do this without installing on users computer.
I'd like to be proven wrong, but atleast this is an answer for you.
Get as much Info as you can about the user environment using jQuery. (jQuery.support) / user agent / cookies / form input values, the url (for get parameters and to know which page had an error)
Send the source of the page like mentionned by Moff.
Try serializing the DOM as it is now so you can compare what is different from the original page.
It is also useful to send the source of the page if you need to keep it for historic purposes, since when you update the page, it will be become different.
I'd suggest some sort of integration with FireShot which is a Free Firefox/IE addon.
I agree with the other answers -- no dice.
However, there is a firefox plugin, the Pearl Crescent Page Saver, which might be worth looking into for related tasks.
Take a look at pagecrop (implemented with jQuery + jCrop plug-in)
I must be missing something, but can't you just...
Press PrtScr on keyboard and paste into email.
See this question. Basically, no, not with javascript. Perhaps with ActiveX, but that's back to installing things on the client's PC.
Consider writing a server-side script that repeats the user's request exactly (assuming it's not after a POST) and storing the resulting html file.
You might look into using a web based solution such as the one offered at Super Screenshot! or WebShotsPro.com. Depending on your needs, such as screenshots of specific areas of pages, or pages inaccessible from the outside world, it may not work for you, but it is an idea.
Chrome plugin
https://chrome.google.com/extensions/detail/ckibcdccnfeookdmbahgiakhnjcddpki
You can also take a look at how Evernote does its screen capturing and maybe you can tie in to that or create your own chrome extension. https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en

Categories

Resources