// ==UserScript==
// @name Highlight Link Reference Issue
// @match https://fiu.instructure.com/*
// @exclude https://fiu.instructure.com/courses/*/link_validator
// @exclude https://fiu.instructure.com/courses
// @exclude https://fiu.instructure.com/courses/*/content_migrations
// ==/UserScript==
let blackboardLinks = document.querySelectorAll('#content_listContainer a');
let canvasLinks = document.querySelectorAll('#content a');
let items = [];
let linkFlag = 'xid-';
let canvasCourseID = document.location.href.match(/\/(\d{4})\//i)[1];
for (let l of blackboardLinks) {
if (l.href.includes(linkFlag)) {
items.push(l.innerText);
l.setAttribute('style', 'border: #FF0000 4px solid;');
}
}
if (items.length > 0) {
// alert (`There are ${items.length} old link(s) on this page highlighted in red.`);
// List out items in console
console.log(items);
}
for (let l of canvasLinks) {
if ( l.href.includes(linkFlag) || ( l.href.includes('fiu.instructure.com/courses/') && !l.href.includes(canvasCourseID) ) ) {
items.push(l.innerText);
l.setAttribute('style', 'border: #FF0000 4px solid;');
}
}
if (items.length > 0) {
// alert (`There are ${items.length} old link(s) on this page highlighted in red.`);
// List out items in console
console.log(items);
}