• Skip to primary navigation
  • Skip to content
  • Skip to footer
Alberto Roura The place where I release.
  • Personal
  • Technical
  • About
  • Contact
    1. Home
    2. /
    3. Javascript script to add a data-useragent tag to the HTML
    Alberto Roura

    Alberto Roura

    Born in Spain, now in Australia. This is my little, Internet space.

    • Asia-Pacific
    • GitHub
    • LinkedIn
    • Twitter

    Recent posts

    Speed Up Alibaba Cloud OSS Deployments By Zipping The Files

    Using AppleScript To Create Smart Albums In Photos Based On Resolution

    Launching NFTool PRO To Help Artists With The Blockchain

    Javascript script to add a data-useragent tag to the HTML

    August 3, 2017 less than 1 minute read

    // Adds the user agent to a data attribute in the HTML
    document.documentElement.setAttribute('data-useragent', navigator.userAgent);
    

    Tags: gist, javascript

    Categories: Technical

    Updated: August 3, 2017

    Previous Next

    Related Posts

    Get the closest Feature in a FeatureCollection against a given Feature

    August 10, 2017 2 minute read

    This script returns the properties of the closest Feature in a FeatureCollection against a given Feature (GeoJSON RFC7946).

    Bookmarklet to inject an external CSS file into any website

    August 3, 2017 less than 1 minute read

    This bookmarklet provides an easy way to test css styles against a website without access to its server by creating a <link/>element in the <head>...

    • Follow:
    • Twitter
    • GitHub
    • LinkedIn
    • Feed
    © 2023 Alberto Roura. Powered by Jekyll & Minimal Mistakes.