123

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div>
  <table id="cookieContainer"></table>
</div>
            
          
!
            
              (function($) {
  "use strict"; // Start of use strict
  let userLanguage = $("<tr></tr>").text(
    "User Language: " + navigator.language
  );

  let javaEnabled = "";
  if (navigator.javaEnabled()) {
    javaEnabled = $("<tr></tr>").text("You have Java enabled");
  } else {
    javaEnabled = $("<tr></tr>").text("You have Java not enabled");
  }

  let cookiesEnabled = "";
  if (navigator.cookieEnabled) {
    cookiesEnabled = $("<tr></tr>").text("You have Cookies enabled");
  } else {
    cookiesEnabled = $("<tr></tr>").text("You have Cookies disabled");
  }

  let doNotTrack = "";
  if (navigator.doNotTrack) {
    doNotTrack = $("<tr></tr>").text(
      "You asked this website to not be tracked"
    );
  } else {
    doNotTrack = $("<tr></tr>").text(
      "You haven't asked this website to not be tracked"
    );
  }

  let hardwareConcurrency = $("<tr></tr>").text(
    "Your device has " + navigator.hardwareConcurrency + " threads"
  );

  let touchDevice = "";
  if (navigator.maxTouchPoints == 1) {
    touchDevice = $("<tr></tr>").text("You're using a desktop or laptop");
  } else {
    touchDevice = $("<tr></tr>").text("You are using a smartphone or tablet");
  }

  let userBrowser = $("<tr></tr>").text(
    navigator.vendor + " is the developer of your browser"
  );

  let dateAndZone = $("<tr></tr>").text(
    "The date, time and timezone you are in: " + Date()
  );

  let OSName = "Unknown OS";
  if (navigator.appVersion.indexOf("Win") != -1) OSName = "Windows";
  if (navigator.userAgent.indexOf("NT 5.1") != -1) OSName = "Windows XP";
  if (navigator.userAgent.indexOf("NT 6.0") != -1) OSName = "Windows Vista";
  if (navigator.userAgent.indexOf("NT 6.1") != -1) OSName = "Windows 7";
  if (navigator.appVersion.indexOf("NT 10.0") != -1) OSName = "Windows 10";
  if (navigator.appVersion.indexOf("X11") != -1) OSName = "UNIX";
  if (navigator.appVersion.indexOf("Linux") != -1) OSName = "Linux";
  if (navigator.appVersion.indexOf("Android 4") != -1)
    OSName = "Android KitKat";
  if (navigator.appVersion.indexOf("Android 5") != -1)
    OSName = "Android Lollipop";
  if (navigator.appVersion.indexOf("Android 6") != -1)
    OSName = "Android Marshmallow";
  if (navigator.appVersion.indexOf("Android 7") != -1)
    OSName = "Android Nougat";
  if (navigator.appVersion.indexOf("Android 8") != -1) OSName = "Android Oreo";
  if (navigator.appVersion.indexOf("Android 9") != -1) OSName = "Android Pie";
  if (navigator.appVersion.indexOf("Mac") != -1) OSName = "MacOS";
  if (navigator.userAgent.indexOf("Mac OS X 10.4") != -1)
    OSName = "MacOS Tiger";
  if (navigator.userAgent.indexOf("Mac OS X 10.5") != -1)
    OSName = "MacOS Leopard";
  if (navigator.userAgent.indexOf("Mac OS X 10.6") != -1)
    OSName = "MacOS Snow Leopard";
  if (navigator.userAgent.indexOf("Mac OS X 10.7") != -1)
    OSName = "MacOS Lion (Barolo)";
  if (navigator.userAgent.indexOf("Mac OS X 10.8") != -1)
    OSName = "MacOS Mountain Lion (Zinfandel)";
  if (navigator.userAgent.indexOf("Mac OS X 10.9") != -1)
    OSName = "MacOS Mavericks";
  if (navigator.userAgent.indexOf("Mac OS X 10.10") != -1)
    OSName = "MacOS Yosemite";
  if (navigator.userAgent.indexOf("Mac OS X 10.11") != -1)
    OSName = "MacOS El Capitan";
  if (navigator.userAgent.indexOf("Mac OS X 10.12") != -1)
    OSName = "MacOS Sierra";
  if (navigator.userAgent.indexOf("Mac OS X 10.13") != -1)
    OSName = "MacOS High Sierra";
  if (navigator.userAgent.indexOf("Mac OS X 10.14") != -1)
    OSName = "MacOS Mojave";
  if (navigator.userAgent.indexOf("iPhone") != -1) OSName = "iOS";
  if (navigator.userAgent.indexOf("iPhone OS 8") != -1) OSName = "iOS v8";
  if (navigator.userAgent.indexOf("iPhone OS 9") != -1) OSName = "iOS v9";
  if (navigator.userAgent.indexOf("iPhone OS 10") != -1) OSName = "iOS v10";
  if (navigator.userAgent.indexOf("iPhone OS 11") != -1) OSName = "iOS v11";

  let userOS = $("<tr></tr>").text("You are using " + OSName + " as your OS");

  let userScreen = $("<tr></tr>").text(
    "You're display is " +
      screen.width +
      "px wide and " +
      screen.height +
      "px high"
  );

  let userDisplayColor = $("<tr></tr>").text(
    "Your hardware color resolution is " + screen.colorDepth + "bit deep"
  );

  $("#cookieContainer").append(
    userLanguage,
    javaEnabled,
    cookiesEnabled,
    doNotTrack,
    hardwareConcurrency,
    touchDevice,
    userBrowser,
    dateAndZone,
    userOS,
    userScreen,
    userDisplayColor
  );
})(jQuery); // End of use strict

            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console