var url_path = window.location.pathname;

console.log("Is viewing content: " + isViewingContent(url_path));
console.log("File name: " + getFileName());
console.log("Is a PDF: " + isPDF());
console.log("Is a DOCX: " + isDOCX());
console.log("Is a TXT: " + isTXT());
console.log("Course ID Number: " + getCourseIdNumber());
console.log("Course Label: " + getCourseLabel());
console.log("Download link: " + getDownloadLink());

// Returns true if user is viewing a 
// file to download, false otherwise
function isViewingContent(url_path) {
  // if path contains "viewContent"
  if (url_path.indexOf("viewContent") > -1) {
    return true;
  }
  return false;
}


var url_path = window.location.pathname;

console.log("Is viewing content: " + isViewingContent(url_path));
console.log("File name: " + getFileName());
console.log("Is a PDF: " + isPDF());
console.log("Is a DOCX: " + isDOCX());
console.log("Is a TXT: " + isTXT());
console.log("Course ID Number: " + getCourseIdNumber());
console.log("Course Label: " + getCourseLabel());
console.log("Download link: " + getDownloadLink());

if (isViewingContent(url_path)) {
  addDropboxScriptTag();
}

// Returns true if user is viewing a 
// file to download, false otherwise
function isViewingContent(url_path) {
  // if path contains "viewContent"
  if (url_path.indexOf("viewContent") > -1) {
    return true;
  }
  return false;
}


Add dropbox script when viewing content
Add dropbox script when viewing content
