Paul Bradley • Solutions Architect & Software Developer

Published: • Updated:

Frontend Tips and Tools

A collection of tips and tools that I use my web applications which enhance the frontend development

midjourney ai - a fantasy rhino with crystal horns

Table of Contents
  1. Preventing browsers auto-completing a field
  2. Preventing browsers from trying to translate the web page to another language
  3. Define a blank favicon within your HTML head
  4. Validating HTML
  5. Preventing users opening developer tools
  6. Preventing users printing your applications content
  7. Joined bullet point lists with CSS
  8. Using custom markers within lists using CSS
  9. Manipulating placeholders with CSS
  10. Send AJAX request as a HTTP POST with an Authorization Request Header

 Preventing browsers auto-completing a field

Sometimes it’s important to not show the user previous search values. When you need a distraction free input field, so the user can concentrate on the data they are currently entering, use the autocomplete attribute of an HTML field and set the value to off.

<input id="q" name="q" size="12" minlength="10" maxlength="10" required autofocus autocomplete="off">

 Preventing browsers from trying to translate the web page to another language

If you need to prevent browsers from trying to auto translate you web page into another language, and you’ve already the lang attribute then set the translate attribute to no.

<!DOCTYPE html>
<html lang="en" translate="no">

 Define a blank favicon within your HTML head

If your web application doesn’t have a specific favicon and you want to prevent lots of 404 errors within your server log files, then include an in-line blank favicon like:


 Validating HTML

This seems to have dropped out of fashion. I don’t hear web developers talking about it much. I still validate the HTML my web applications produce to ensure it’s valid markup. You can check that this page is valid

 Preventing users opening developer tools

If you want to discourage users viewing your source HTML or opening the developer tools then look at using disable-devtool. While it won’t prevent the most technical savvy users who know how to request your page from curl, it will prevent the majority of non-technical users. I use a feature flag within my code to enable this within pre-production and production environments.

 Preventing users printing your applications content

As I mainly develop web applications for the health sector, I need to try and prevent or persuade them not print the pages as they might contain patient identifiable information. To do this I use a print style sheet to hide all the content except the content within the pages footer.

The footer contains the message to persuade users not to print the information like:

    <p>We <b>strongly recommend</b> not printing patient information from this application as
     it is constantly being updated by many organisations and it will be out of date very quickly.
    Please always consume (view) the latest information about your patient so that you are
    delivering safe and informed care based on the most up to date information available.</p>
    <hr />
    <p>Please <b>DO NOT</b> take photos of the screen as this will break the terms of your employment.</p>

A sample print style sheet is shown below. It hides the main content and shows the footer content. The font size of the text within the footer content is bumped up so that it’s easily readable within the browsers print pre-view window.

@media print {
    main {
        display: none;
    footer {
        display: block;
        font-size: 22px !important;
        margin: 2em;

 Joined bullet point lists with CSS

I like the joined bullet point lists with CSS first developed by the BBC. It’s a great way to show a vertical timeline of events. Here’s my take on it:

li {
    position: relative;
    margin: 0;
    padding-bottom: .75em;
    padding-left: 20px;

li:before {
    content: '';
    background-color: #00669f;
    position: absolute;
    bottom: 0;
    top: 0;
    left: 6px;
    width: 3px;

li:after {
    content: '';
    background-image: url("data:image/svg+xml,%3Csvg xmlns='' aria-hidden='true' viewBox='0 0 32 32' focusable='false'%3E%3Ccircle stroke='none' fill='%2300669f' cx='16' cy='16' r='10'%3E%3C/circle%3E%3C/svg%3E");
    position: absolute;
    left: 0;
    top: 2px;
    height: 15px;
    width: 15px;

And the HTML:

    <li>22.08.2022 - Change Grow Live go-live with 50+ clinical staff</li>
    <li>18.08.2022 - Passed 10,000 registered users</li>
    <li>25.07.2022 - Delivered the Cyted Results uploading and publishing functionality</li>

 Using custom markers within lists using CSS

Use the marker attribute to define the content to use for custom list markers.

li::marker {
    content: '➡️ ';

 Manipulating placeholders with CSS

Style the placeholder text and change the border if the placeholder text is visible.

input:placeholder-shown {
    border: 1px solid red;

input::placeholder {
    color: rgb(255, 255, 255, 0.75);

 Send AJAX request as a HTTP POST with an Authorization Request Header

Make your AJAX API request more secure by sending as an HTTP POST with an Authorization request header that the web server needs to verify before processing your request.

try {
    var xmlHttp = new XMLHttpRequest();
    xmlHttp.onreadystatechange = function() {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            // use the API's response
        if (xmlHttp.readyState == 4 && xmlHttp.status != 200) {
    }"POST", "/url/to/api", true);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader('Authorization', 'BearerTokenValue');
} catch(e) {