Best ways to detect what kind of bandwidth the user has? [duplicate] - javascript

This question already has answers here:
How to detect internet speed in JavaScript?
(12 answers)
Closed 5 years ago.
I'm trying to optimize my application experience based on the kind of bandwidth the user has. For example, if the user is on a really slow 2G connection, I would render fewer graphics and less content, for high speed connections, I would include video, animations, etc.
Are there JS libraries that allow you to do this? What's the best practice?

Even if you get the connection type for a user you will not be able to guarantee that is working as expected.
I suggest to explore
Navigation timing API to implement a guess of the client's current download speed.
This blog also have good ideas around that.

Related

How to prevent pirating of online javascript software? [duplicate]

This question already has answers here:
How to prevent your JavaScript code from being stolen, copied, and viewed? [closed]
(10 answers)
Closed 7 years ago.
I've developed web software that I would like to start leasing to companies.
It is a javascript program that works as module that only needs linked from their site to utilize.
What are the methods available to secure that the scripts only work for selected clients, paying customers?
I was thinking I could provide them with a code that would need to be verified in my database before printing out the javascript to their page, but after the first fetch they would gain access to the javascript which they could copy and thus never have the need to pay again..
Moving your business logic code to the server is the only reliable way.
Of course you could obfuscate your code and have it only work by fetching a token from your server, but that'll get cracked eventually and obfuscated code has a real performance cost.

Client Side Performance - Laptop and Desktop Specific [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am new to front end development. Let's say hypothetically my clients have modern hardware, 2.20 GHz CPU, 4GB ram. A flashy website that uses a lot of event handlers, and animations like "slide for div containers to move in and out on users click" and "jquery "on" click for mustache templates created on the fly with ajax (for elements being added after initial DOM load).
I know it depends if my programming skills are really terrible which could be causing the user end to perform really poorly, but lets say I program as close to efficient as possible, and use very well written plug-ins.
Question - Do clients with that hardware handle a highly customized design well? Are browser development tools the best out there in terms of troubleshooting and analyzing performance, or is there a highly popular widely used tool that does the job for a lot of developers?
My question focuses on two key points.
Client Side Performance based on sleek and flashy websites using
plugins mentioned below on modern hardware.
What do developers use to help them check hardware utilization,
profile and troubleshoot issues.
browser development tools is sufficient?
A popular tool widley used by developers that I haven't discovered?
Additional Notes
I am also using my application server to host these files since I am using MVC so its not completely static html files. Plugins include:
Jquery
BootstrapJS
Bootstrap Max Length
Jquery UI(Effects Corewith Slidejs, its 14Kb in size)
Jquery Uniform
MustacheJS
Jquery Uniform took the biggest hit on page load times I called it on about 100 elements when the page loaded. So I changed it by calling it on elements that needed it when the client clicks on a div to slide open on specific selectors.
What influenced my question?
Toying around and reading about Angularjs. Since everything is client side, I read mixed feelings on it slowing the client down and possibly speeding it up. Since I am already knee deep in Jquery I was curious how well it performs with the more modern hardware using a lot of flashy components and DOM manipulation that I mentioned above. This is my first front end design, so I know more seasoned Front End Developers know how well browsers handle these knew frameworks being used.
Why it's important
The temptation to add all the glitter and flashiness to a webpage to make it look more attractive to the client, could actually work against me is a concern.
In my experience you can have hundred of thousands of DOM elements, thousands of objects with arrays inside and nothing happens. In the web are many awful sites made up like Frankenstein's monsters with literally dozens of libraries and have not performance problems in computers from 15 years ago.
While you don't mess with 3d rendering and that experimental things you won't have problems in mainstream PCs. I don't know what your flashy cool features are. Also if you are very bad programming and make almost never-ending loops or something like that could be a problem, but that's anywhere.
Another problem is the download time, and is the most important thing to care about, if you have tons of code it will take longer to download. Usually in server applications you prefer performance before lightness but in the front end is better to download small files. Internet always will be slower than the CPU and RAM.

How to prevent people from sharing your images once downloaded? [duplicate]

This question already has answers here:
How do I prevent people from stealing photos from my website?
(5 answers)
Closed 8 years ago.
Me and a friends are going to start up a website where we sell images for educational purposes. However, as being the website designer and coder, one of the things that bother me is that once a person buy a copy, they can simply upload it for free or give it to their friends once downloaded. Therefore completely shutting down the business and making it pointless to sell in the first place.
I was wondering if there was a way to protect these images from being shared or simply being "given out" for free. Of course we could make account from which people could access the images from but that would make one of our feature "offline usage" completely pointless. Is there any other better way to do this?
Thanks.
There is no technological way to enforce copyright. DRM doesn't work on complex systems where the hardware vendors collaborate to try to enforce it, let alone on open standards. Use copyright law instead.

What is ORBX.js [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
What is ORBX.js and how does it relate to the following points I thought were only available on a operating system (Not Web, but actually running in the system):
Watching a 1080p video without codecs
Playing a game (Like Left 4 Dead 2) on the Web
What characteristics does it offer for the web that we are used to seeing on a non web system (With this i mean running an app that is not web related, like a computer game)
How is this possible?
For a non-critical "this is super awesome" piece for those who have not yet heard of this technology, see this write-up: Today I saw the future (this is the same as mentioned by Jonathan in the comment above - and yes, its kind of a puff piece)
To digest it, this is the latest re-emergence of the concept of the thin-client. In short, the viewing device uses a web browser to launch a "stream" that is very much like a virtual/remote desktop. It specifically allows remote desktop applications itself, but it also allows something where the behind-the-scenes implementation is different; this is the "GPU cloud" referred to.
What makes this a thing is that it would effectively allow future computers/devices to target one stationary target - the ability to run a web browser and decode a video stream, and if they can do that then they can just as well any application or program imaginable, no matter how intensive it might be. This is because all the processing would be done in the cloud, with the only thing sent to the client being a video stream. In theory this could extend consumer hardware cycles and cut prices, as a 1ghz CPU would be just as good as a 100ghz.
In reality, the obstacles are bandwidth, latency, connectivity, and of course a successful implementation of this technology with wide-spread marketplace compatibility. Then, of course, you start having to pay for cloud computing as a cost of using your cloud-based applications. And without a fast internet connection, you are back to using native downloaded apps only.
For now there is no open encoder, which is a problem for developers and programmers. Only time will tell if it is a viable technology.

Internet connection code using html5 [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Will HTML5 allow web apps to make peer-to-peer HTTP connections?
I want to make a Internet connection from one device to another how to do the coding of it using html5 and javascript
You can't - at least not directly.
Not only does JS not include any suitable APIs, but things like NAT devices tend to get in the way of device-to-device connections.
Possible work arounds include having both devices make a connection to a central server, perhaps using WebSockets.

Categories