0

This site (https://html5test.com/index.html) can be used to list browser features upon visiting. I'm using ElectronJS (Chromium-based) and I'd like to have control over the features that get reported to feature detection mechanisms.

I can do something like window.XMLHttpRequest = function() {}; but what about other things like events? For instance, the Script execution events feature expects to be able to s.addEventListener("load",callback,false);. Maybe CustomEvent? There are also many form field types (date, month, week, time). How can I emulate them?

I would also like to know how to report any such features as missing. There are more features I'd like to remove than add.

xendi
  • 2,332
  • 5
  • 40
  • 64
  • Did you check https://github.com/Modernizr/Modernizr – XIMRX Apr 29 '17 at 10:32
  • I had assumed that's what that site is using to detect features. Are you saying it can be used to emulate them as well? That isn't immediately obvious if so, "Modernizr tests which native CSS3 and HTML5 features are available in the current UA and makes the results available to you." – xendi Apr 29 '17 at 10:34
  • Modernizer can detect which features are available and which are not, since it is JS you have to emulate it yourself, I can assist if you need. – XIMRX Apr 29 '17 at 10:37
  • I'm not trying to detect features. I'm trying to report them as there when they are not and not there when they really are. – xendi Apr 29 '17 at 10:38
  • For detection Modernizer is best library but I don't know about any reporting library, you have to code it yourself – XIMRX Apr 29 '17 at 10:41
  • I know I have to code it myself. I'm asking how it might be coded. How would you fool Modernizer? – xendi Apr 29 '17 at 10:46
  • Why do you want to do this? –  Apr 29 '17 at 10:47
  • What i understood is, you want to know what features are missing in browsers and then you want to notify user about them, Moderinizer will tell you which features are missing and you can notify them to user. Can't understand why you want to fool Moderinizer. – XIMRX Apr 29 '17 at 10:48
  • 1
    I don't want to know the features. I want to misreport/fake/falsify/trick/fool/lie to Modernizer using Javascript and ElectronJS. As to why: Privacy-based reasons. Feature-detection renders user-agent faking mute. Also, it's fun. – xendi Apr 29 '17 at 10:51
  • You should really explain your intents better. You want to change which features appear to be available for a page loaded in a Electron environment. So you intend to load random web pages in it? Why would you care about User-Agnet faking, if you’re in control of the user agent? – idmean Apr 29 '17 at 11:50
  • I want full control over what my browser reports to be by any means, not just the agent string. – xendi Apr 29 '17 at 18:36

0 Answers0