How to create Browser Canvas Fingerprint for digital output - javascript

I need to create canvas fingerprint for device identification. So, i have seen so many blocks are available on the web. But, nothing is useful because I need raw coding only to apply on my site. i saw in codepen.com has some coding is working fine but they all are demo version only. periodically and automatically the canvas is changing. These all are similar. you can see at: 1)codepen.io/run-time/pen/XJNXWV
2)codepen.io/alpenzoo/pen/vRywwV
3)codepen.io/tjoen/pen/MYbeoy
those all are working fine, but all are like trial version.
So, anyone can help me to give raw coding to create browser fingerprint and output same as above in digital.

Related

CefGlue silent printing to PDF

I have latests CefGlue version (3.2272.2035)
I need to save current page as PDF. I'd like to interact with my CEF somehow (JS/C#) and make it create PDF for me.
I've tried to use javascript.window.print() for that purpose with no success, because, all i've got is such window.
I've found OnPrintJob method in CefPrintHandler but I don't know what is the right way to call it + comments say: "Implement this interface to handle printing on Linux"
and I need to handle printing to pdf on Windows environments (both x64/x86)
Any code example would be appreciated. Thanks in advance for any help.
You'd need to merge this patch and recompile cef from source; Besides, you might have to add some glue logic to CefGlue. I tested the patch myself (on C++ API) and it worked fine.
EDITED: the patch will be merged in trunk.
If you only need to print some pages (specially if these pages are under your control), you will do just fine. However if you need (as I did at the time) to print almost anything, you'll probably face the fact that some web pages don't render anything useful to the print view. Also, even those well-behaved diverge significantly from what you see on the screen - and that's not a CEF behavior, as even google chrome showed the same issues. In my application this was a no-go so I dropped printing and started capturing the screen (and implemented saving that to a pdf using a pdf library in C++), but perhaps your application isn't as demanding as mine was. Cheers!

How Do I Use Smokescreen/JavaScript to Convert Flash to an Image

I have a simple script from AccuWeather to display a weather button on my website:
I love the simple way this button displays. It's perfect for what I want.
However, the button generated is in Adobe Flash format (swf) and doesn't display on most mobile devices since iOS and Windows Phone have no support and Flash Player for Android is no longer available for download from the Google Play app store.
I thought I found a solution in an Open Source project called Smokescreen that has its development area at Github.
I don't need this to reproduce flash movies. All I need is a simple javascript-based conversion of the flash button to a flat image that can be displayed in any browser that can execute javascript, which includes mobile devices.
But the documentation and description of how to use Smokescreen at their GitHub site is minimal at best, and I'm not a javascript expert and cannot get it working.
The call I am making that obtains the Flash image from AccuWeather is:
<script src='http://netweather.accuweather.com/adcbin/netweather_v2/netweatherV2ex.asp
?partner=netweather&tStyle=whteYell&logo=0&zipcode=NAM|CA|MB|WINNIPEG|
&lang=eng&size=7&theme=blue&metric=1&target=_self'>
</script>
Can anyone tell me what the javascript would be to use Smokescreen to display the flash image produced by the above code as an image.
If Smokescreen can't do it, is there any other method that can do this live on a webpage?
Just tested smokescreen with the SWF of the page you posted, and it doesn't work, you will need to parse the SWF at server side if you still want to use that site.
I opened the dev console and tracked down the SWF from the iframe
copied the file into my computer, then
cloned the github repo and
edited the player.html (from the github repo), line 13 to point to the file I downloaded.
This is the SWF I downloaded: http://netwx.accuweather.com/netWx-V212.swf?zipcode=46958
Edit: this is the error message I got from the dev console:
TypeError: this.defineEditText is not a function [loader.js:136](https://github.com/cesmoak/smokescreen/blob/master/src/player/loader.js#L136)
My system asks for permission to allow the SWF to connect to netwx.accuweather.com.
A quick search on github reveals some nice pure javascript alternatives.
https://github.com/search?l=JavaScript&q=weather&ref=searchresults&type=Repositories
I think this one looks the most promising: http://simpleweatherjs.com/
This simpleweatherjs demo shows a nice icon as well: http://codepen.io/fleeting/pen/wHism
unfortunately there is no way your javascript can handle swf, espacially on mobile devices like whith ios or windows phone since the javascript is running on your device itself.
all you could try is to use swfobject which is described as a workaround for javascript
here is the documentation of swfobject
Have you considered using a headless browser like phantomjs? You could use something like Selenium instead for out-of-the-box plugin support, but there are headless options for Flash.
The beauty of such software is that it can automate any user task (that's why it's used for testing). Like logging onto a site and performing a search that would normally not be available externally because of antiforgery tokens. Or checking if a product's price has changed by seeing if its DOM element value's has changed. Or accessing your online banking to see if your balance is a prime number and rendering your credit card bill in fractal form.
I mean, if you want to go this far for a weather widget, you probably have power user needs :)
...also Accuweather seems to do a fairly similar mobile-friendly version. And if it's not 100% the same, you could always ask.
Edit: check their T&C, the mobile-friendly snippet might actually be the only option for legal reasons.

how to speed up html5 game

Have made a typing game using HTML5 and javascript http://tweetraitor.herokuapp.com/.
Now I wanted to ask a couple of things
Images load each time the user plays the game. Though I have used img.src to load the image at the beginning.Why is it not loading from cache?
How can I speed up the game in general. The bullet firing mainly.
Code for the game area is here.
https://github.com/rohit-jain/Tweetraitor/blob/master/app/views/guests/play.html.erb
Thanks!
Rohit Jain
I can tell you for the first part of the question that you may want to try to cache the images in base64 into the localstorage of the user. This way, the data will already be loaded client side and won't require the client to download everything.
Here is a blog post about how to do it .
In short, you have to check if the image is in the local storage
if ( localStorage.getItem('myImageId')) {
if not to save it into it
localStorage.setItem('myImageId',image);
our general experience with HTML5/JavaScript/CSS based games on Android is that it is very slow - we have games we are using across platforms (desktop, TVs, iPhone) but for the Android we rewrite them natively in Java...
Even simple games like pong (the bouncing ball) are slow even on new devices. The situation is much worse when you try it on underpowered ~100-150 EUR devices from ZTE, Huawei or HTC.
If you will find out some general solution we will be more then happy to use it, but i doubt there is any. Does not matter if you are using some framework (i.e. Sencha touch) or not.
See there also.
Regards,
STeN

Screen orientation information generated by Javascript won't display in Android emulator

I'm learning Android development using Pro Android Web Apps (Apress, Auths: Damon Oehlman & Sebastien Blanc). I ran into a snag in the second chapter (not a good sign if I'm having trouble already). I couldn't find any help from the Apress site on the book, so I'm hoping you guys can help me out here.
The chapter has me build an html, css, and js file that are supposed to detect and display the orientation of the device as the user rotates it (rotates the device, that is :) ).
When I run the code in an Android emulator running on my local WAMP server, the page displays ok (I don't think the css is quite right, but that's no big deal), but the data regarding the orientation isn't being displayed at all. I made sure the link to the js file is correct, and I've even downloaded all three files from the Apress site to see if it's something in my code, but those won't work either. The book's code is written for v2.1.
I have posted the code for the three files here. Since I'm working through the book using a local WAMP server, I don't really know how to make it easier for someone to take the files and test them his/herself. Sorry.
I really hope someone can take a look at the code and help me out. I'd really appreciate it, so I can continue on working through the book!
Thanks!
[Edit]
I just figured out how to change the orientation in the emulator and the display does rotate, but again, the output that the js is supposed to generate isn't displaying after the bulleted items.
I can't help too much but recommend that you use an actual device for things like this. If you still wish to use the emulator, make sure you choose Android 2.1 for the OS. You can also debug using the equivalent of System.out.println by using Log.d("tagname","line to be displayed"); which will display lines onto DDMS (which if you're using Eclipse can be seen by selecting Window -> View Perspective -> Other -> DDMS which will really help you debug this problem more!

How can one paste images into a Web App? What solutions are available? HTML 5 Canvas?

I'm currently building a very bare bones web app, that had the requirement of being able to copy an image while broswing the web, and then pasting it onto my page.
I know that this type of functionality IS possible - as I've pasted images into gmail while writing messages, and into Tumblr (I believe they use TinyMCE as their editor).
After long searching - I've been saddened by the poor quality of explanation for the available solutions out there.
This is what I've gathered:
$(document).bind('paste', function(e){
console.log(e);
})
Inspecting the event object, it seems that data is only included when there is text (in Chrome anyways).
I am aware that IE has a clipboardData object which gives you access to the clipboard contents.
I've also heard of possible solutions using Flash, Java Applets, and HTML 5 Canvas - but I haven't yet been able to find good write ups explaining those solutions.
Anyone done this successfully, and can suggest best practices?
This works fine in Chrome. Here's a live example supporting getting image data in pure JavaScript with no servers involved: http://strd6.com/2011/09/html5-javascript-pasting-image-data-in-chrome/
You could use the Clipboard API: http://dev.w3.org/2006/webapi/clipops/clipops.html
Or you can do is to use Zero ClipBoard. It uses an invisible Flash movie and provides a JavaScript interface to access the clipboard.

Categories

Resources