Any way to detect browser running through Terminal Services? - javascript

I am working on a site that has some jquery based animation, and I was wondering if there is any way to detect if the site is running in browser that is being run in a terminal services (remote desktop) session so I can disable the animation?
I run through remote desktop quite often from remote locations and animations always annoy me, but I really like them when I'm not running through remote desktop. Is there any way to ease the pain without getting rid of animations all together?
I guess I could allow the user to turn them off, and have it store a cookie... but is there any way to do it automatically?

This is almost certainly impossible with JavaScript (way, way above the level JavaScript operates at). It may be possible via something like Flash or ActiveX.
Edit: You will likely need something along the lines of what nVidia is using here: http://www.nvidia.com/Download/Scan.aspx?lang=en-us
Looks like a Java applet.

If the site animation is annoying to you, you may want to take it off completely as it may be annoying to site users?
I would suggest not building in extra code to stop the site from displaying as it should, in some cases users of the site may be running terminal services themselves (creating a point of failure)
If the animation is some kind of intro you could have a "skip" feature that switches it off an use a cookie as you mention.

Related

Minimizing apps via nodejs || plain js

I'm currently working on personal automation project and I want to add 'minimize app' feature.
For example: When I click button, I want to minimize the current browser. I already have window.close(); but this will close the app definitly. I found things like window.minimalize(); or window.minimize();, but none of them worked for me. So is there a way to minimize app?
Edited: It does not have to be only client-side JS, it can be used as terminal based nodejs app. Ex: I type minimize Google Chrome, and it will minimize it.
One Google search for how to minimize browser gives the following result:
There is no way to minimize the browser window within javascript. No, there isn't. However, depending on what you're doing and which browsers you're targeting, you could play around with the blur and focus events of the window to achieve similar effect.
Alternatively, if such control is required, you could always port your code to Electron.js or Neutrino.js, which were made to let you create desktop applications using JavaScript.
Maybe if you post some code and give us a train of thought to follow, we could work something out.

Node.js Automate Login and Upload

I currently have a node.js script that automatically creates a group of files and then zips them ready for being uploaded on a site. I'm trying to add one extra piece of functionality to the script that will log into the site and upload the file itself.
I've done some reading around and found a lot about headless browsers but not sure if that's the right path to go down as they seem to rely on other applications like chromium and they're focused on testing sites.
Does anyone know where I should start looking?
In my current project I am using the following library from Google, puppeteer. I personally found it to be very easy to use, and it even provides access to the dev protocol that Google Chrome has.
I've done some reading around and found a lot about headless browsers but not sure if that's the right path to go down as they seem to rely on other applications like chromium and they're focused on testing sites.
Yes, they are often used for testing, to assure that the correct things are rendered on screen etc. However, in many scenarios, like yours, the use of a headless browser to interact with a website is totally legit in a non-testing scenario.

How to monitor and/or throttle rate limit cpu/bandwidth by client-side web pages?

Nowadays it appears that many webpages want to use my cpu/harddrive/bandwidth in order to show me their ads/pages/information in beautiful but expensive ways.
Often I like these new pages, but sometimes I'm a curmudgeon and am just annoyed that my fan starts spinning and the EMF loads rise when I open the pages.
Is there a browser/plugin that I can use to throttle, best case, and/or monitor, worst case? I am not very knowledgeable of the Reactive JS, etc techniques, so I am hoping there is an easy solution?
thank you!
Anne
ps Normally I use Firefox but of course I have Chrome on my machines (win8, win7, mac 10.8) as well.
You need a client side javascript manipulator.. they are known as User Scripts... For firefox, you want something like grease monkey.... its worth a google... This is not the simplest method, but most effective.
Otherwise you will just want a ad-remover addon for firefox.
Example For Chrome: https://chrome.google.com/webstore/detail/adblock/gighmmpiobklfepjocnamgkkbiglidom?hl=en
They simply search for common code that are used to display adverts (like adsense) and will remove the code from the webpage anytime you view/load a page.
The GreaseMonkey/UserScripts path would be more if you want to customize how your browser interacts with web sites.. For example, you could say for every image on a webpage to be hidden/removed and so on..
As for monitoring, throttling.. Well, you can monitor.. but to throttle.. well that would require a application/proxy that goes between your browser and net connection.
There was one i used years ago that would allow me to simulate a 56k modem speed while developing web pages.
Monitors: https://addons.mozilla.org/en-us/firefox/collections/smayer97/for-managing-bandwidth-usage/
Throttle/Limiter: http://www.netlimiter.com/
OP, in Firefox 68+ (and probably earlier as long as it's Quantum) you can open Tools, Web Developer, Network, or CTRL-SH-E and see how long each element on a page takes to load. It actually has a lot of info. From there you can tell which ad servers are overloaded and take a while to load. Ad servers often slow down a page load because they are busy, but so do larger animated images shown as ads, or ad videos.
I know this isn't exactly a throttle, but it will help you find out more details of what is going on in a specific web page. FWIW, I simply block all ads on most pages and that helps increase load time and reduce bandwidth usage from Firefox.

How to launch a new Internet Explorer process using javascript (iexplore.exe)?

Is it possible to launch new IE process each time when we open new window through Javascript?
Its not possible to do from a in-browser JS, without installing additional stuff on the clients machine!
I mean, for real. Do you really want a website to be able to control the process management of your browser? Think about the performance and security risks! Believe me, you really don't want this!
If you are just in-browser JS, you are just a website. If one website could do this, every website could do this! So its not possible, and thats for a reason!
It would be interesting why u actually wanna do that! I general it's a bad idea to hack around default process management of a application, written by people who know more then you. (like the IE)
If you really wanna do that, and you can run code on another way on the clients, for example by installing software, you some possibilities.
For example, you could use a IE addin, call that addin from JS and let this adding open a new IE process with the new website.
Or you create run a local deamon service, who is opening a HTTP listener on a certain port on localhost. Then every website can call that deamon via AJAX and let it open a new IE with a specific website. Be careful with that! Make sure that only a new IE can be opened, and share a secret key between your website and that deamon, so that only websites who know that secret key can open a new Process!
In every way, remind that its very easy to make mistakes on the implementation who can leak massive security issues! Always think twice about what you make, and be prepared to fix a bug immediately.

Navigation Like Bar on Multiple Websites

I'm currently developing an online learning tool in which users can post links to websites and other users can come along and like or dislike them (adding 1 or deducting 1 to its rating)
At present I'm currently using javascript to create a bookmarklet that once clicked pops up a bar in which users can like or dislike the URL. As expected there are many problems with using this technique; most notable the hassle of having to add the specific javascript into a bookmark.
What I need is a better solution to displaying the like/dislike bar. I was thinking browser extension but that would involve having to code multiple extensions for each different browser. I also considered loading the link within an iframe embedded in the page but iframes are depreciated so I didn't really want to use them.
Wnat I'm wondering is if anyone has any better ideas as to how to display the like bar on the given URLs without users having to go through complicated or annoying installation processes.
Any suggestions will be greatly appreciated!
Thanks
As you pointed out, there are three possible solutions:
1. Websites embed your code voluntarily
This happens with very populare social bookmarking tools only.
Your small service (no pun intented) won't get the market share that people will run after you, so you can forget it.
2. A browser extension
The major players do that: Alexa, Google, Yahoo all provide their own browser extension.
The big advantage is that it gives the best user experience.
It has several downsides:
You need to provide one extension for each browser on each operating system
The user needs to install it, sometimes requiring admin rights. Not all users have that
You probably don't have the man power to develop them
3. A bookmarklet
Works cross browsers
Written in a language you already know (Javascript)
Easy to "install"
There just are no other options for you than to use the bookmarklet.
You should use a script that takes your javascript and packs it into a bookmark. Doing that by hand every time you change something is too chumbersome and you lose joy.

Categories

Resources