Identify the 'unsafe html' content from an accessibility report in Blackboard.

A Blackboard report about accessibility of an unsafe HTML file. There is no preview of the content so you don't know what the error is about.

Sometimes the accessibility report in Ultra refers to "UNSAFE_HTML" files, yet it can be hard to work out what they are because there is no preview.

This solution will list any UNSAFE_HTML files listed in an Ally report and their direct links to open them in the browser console.

Watch video demonstration

Option 1: Use this bookmarklet

This is the simplest option.

  1. Select and drag the below bookmarklet link to your bookmarks bar.
  2. (In Firefox you can also right click on the link below and select Bookmark link).
  3. Then when viewing the Ally report run the bookmarklet and open the console (press F12 and select the 'console' tab) to view a list of the UNSAFE_HTML files and direct links to view them.

List UNSAFE_HTML files in the browser console

A Blackboard accessibility report listing three UNSAFE_HTML files which have the error 'the HTML does not have a language set'.
Run the bookmarklet on a report that shows one or more UNSAFE_HTML files.
A list of UNSAFE_HTML files and direct links to view them, shown in the browser console.
Links to view each of those UNSAFE_HTML files will appear in the browser console, accessible through dev tools.

Option 2: Use Dev Tools and paste JavaScript to generate the list.

This option follows the same process as the bookmarklet, but allows you to be in control and follow the steps manually that the Bookmarklet uses.

  1. Have the Ally report about Unsafe HTML open in a browser.
  2. Press F12 to open developer tools. If F12 does not work, try CTRL + SHIFT + C.
  3. Select the console tab.
  4. Copy the text below and paste it within the editor part of the screen
    
    // Get all the elements that have data IDs
    let fileIDArray = document.querySelectorAll('[data-ally-file-eid]');
    // Make an empty array
    let list = [];
    let unsafes = [];
    // List the file ids in list array
    fileIDArray.forEach(button => {
      list.push(button.dataset.allyFileEid); 
    });
    // list unsafe names in unsafes array
    fileIDArray.forEach(button => {
      unsafes.push(button.dataset.allyInvokePropWindowTitle); 
    });
    // remove first character from each string in list array
    let list2 = list.map(s => s.slice(1));
    // make the URLs
    let list3 = list2.map(i => 'https://blackboard.soton.ac.uk/bbcswebdav/xid-' + i);
    // list the details:
    for(let i=0;i<unsafes.length;i++){
    	console.log(unsafes[i] +=': ' +'\n' + list3[i]);
    }
    // make an alert
    alert('Check the console for a list of unsafe HTML files and links to view them');
    and then press enter. Be sure to have copied and pasted all the text from the snippet.
  5. A list of the UNSAFE_HTML files and direct links to view them will appear in below where you pasted this snippet in the browser console.

Work at another university and want to use this?

The JavaScript is hard coded to our Blackboard address at University of Southampton. To use this at another institution, just change
https://blackboard.soton.ac.uk/
to the address of your institution's Blackboard environment.