Check if custom protocol is installed - javascript

I am working with a safe exam browser (SEB) which is a software that provides proctor mode, when i want to open a website in SEB i just add protocol seb:// instead of https:// in url to open the website in SEB software, but if SEB is not installed it just prints the error in console that schema does not have a registered handler. I have checked a lot of other stack overflow answers and have found out that we have to use different hacky solutions for each browser i.e. onfocus etc. in chrome etc.; but all these answers were very old so I wanted to know if there is any easy implementation for this problem in javascript as of now. Your help is appreciated.

Related

Page loader setup is to fast in localhost environment?

I'm testing a jquery pageloader (queryloader2) offline, but
even frequent browser cleaning, doesn't provide me the ability to see the preloading script in full action, as it zips by so quickly I don't know it it's even doing anything.
How I could simulate online speeds.
Thanks I'll take me answer offline. Dido.
Stackflow:
Your question has been identified as a possible duplicate of another question. If the answers there do not address your problem, please edit to explain in detail the parts of your question that are unique.
(I've searched for a duplicate question, an answer to prevent me from asking. Thanks.)
You can simulate a slower network connection with Chrome Developer Tools. The mode is intended for mobile device emulation, but you can turn off the screen resizing and just use the network throttling feature.

How to read local system without any <input> tag in HTML5?

I have seen answers directing to FileSystem API, But it is said that supported only by chrome and won't be added in W3C specification.
Almost all duplicate answers says 'no'. But they are bit old. Have someone come up with other alternative ? [ Not installing any software ]
I simply want to read a predefined directory like "c:\\folder1".
Edit 1 :
User Interaction is okay. As while accessing camera, they ask for permission. I am fine with it. I just don't want user to give me path.
The answer is still no, and should be no for eternity.
The major concern is security. What if just any site could access your file system? Of course, you can configure what site is allowed to see what directory, but that would be a nightmare if a lot of sites are going to use this. I don't think this is very useful. For this purpose, you have desktop applications.

conflicts between javascript code and browser addon/extension

I am the owner and developer of a e-commerce website.
Every single day some potential customers call us because can not order, we investigate a little bit and inevitably discover he can not because of some js errors.
We check his browser addons/extensions, disable some or all, and the JS errors disappear.
The JS are always different from each other, and the addons/extension vary; it happens with Chrome, IE, Firefox, indifferently. Usually are some sort of coupon/deals addons/extension like DealSpy.
And I don't have any data to support this but I believe these cases had a spike since we moved to angularjs.
I am wondering if there's anything I can do; I can't disable their addons/extension programmatically from my code I guess, but somehow catch those errors and manage them?
Any advice from anyone who faced same or similar issue?
There is likely no way to answer this properly as it depends on the code of your site and the add-ons breaking it, none of which you supply...
Anyway, try to reproduce the error and contact the add-on authors in question.
There might be ways to work around particular issues, but that would be case-by-case and dependent on the actual code.
Also, in case of Firefox add-ons, if you encounter an add-on that just "breaks the web" (or part of it: your website, maybe others), consider filing a Tech Evangelism :: Add-ons bug. Mozilla and/or the add-ons editors team may then take appropriate steps according to the Add-on guidelines.
Not sure if there is something similar for Chrome... Their Help section just says to contact the actual extension author. So unless it is a security sensitive bug, you shouldn't expect any assistance from Google.

How to trigger the "yellow prompt" in Google Chrome or Chromium?

Sometimes while browsing websites using Chrome, you can see a yellow prompt showup. How can I trigger that prompt for my own websites?
For example try going to the The Independent's website and you will be prompted "The Independent now has a Google Chrome Extension. Get the latest news on the topics you like, direct to your browser."
I have previously seen this prompt on Google.com as well, however I assumed that that was something internal for google only websites. This is the first time I have seen the prompt for Non-Google owned websites.
It's a custom look-a-like they've made. Take a look at their javascript file here: http://www.independent.co.uk/independent.co.uk/editorial/javascript/tb.js
It does most of the work. You might be able to get some ideas from there :)
I assume you need to check this question: Chrome - Notify User to install your extension
Looks like there are no standard API for defining extension available for particular site – so you need to imitate such behavior with JS.
If I made a mistake, feel free to correct me in comments.
You are looking for the Infobars API, but this feature is only available for extensions.

Finding the currently logged in user from a Firefox extension

I'm writing a Firefox extension that needs to know what the username of the currently logged in user is in Windows, Mac, or Linux. So if I'm logged into my machine as "brh", it'll return "brh". Any idea how to do that from extension JavaScript?
Firefox extensions play by different rules to normal JavaScript running in the page: finding the current user is absolutely possible.
Open your Error Console (in Tools) and enter this:
Components.classes["#mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get('USER')
The environment variables Firefox was started with are available through that NsIEnvironment XPCOM component.
You may have to customise this per platform. If all else fails, you might be able to create an NsIFile in ~ then look at its .path; I'm not sure if shell expressions are honoured there, though...
The flagged correct answer works fine. I use this in our extension on Firefox 38. I also use events so that the page can communicate with the extension and retrieve windows properties from the extension.
getWindowsProperty: function(prop){
return Components.classes["#mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment).get(prop);
},
Don't think that's possible, seems like it would be a security hole if it were.
Yea, not possible... Javascript runs in a secure enviroment, and all FF extensions are javascript so you wont be able to be doing much interaction with the OS... but ill stick around to see if someone knows a way(it would be VERY cool...)

Categories

Resources