Redefine link on Print button in Activity popup to print in screen mode
当前为
// ==UserScript==
// @name Prognocis Claims Hijack Print Button
// @namespace http://www.hands-onortho.com
// @version 2024-09-30
// @description Redefine link on Print button in Activity popup to print in screen mode
// @author mrkrag
// @match https://handsonortho.prognocis.com/prognocis/scrPatAccountActivity.jsp*
// @icon https://images.squarespace-cdn.com/content/v1/64c7c183cb7ad4611b05dd20/5532a409-6956-49f0-892c-83db654276d8/favicon.ico
// @grant none
// @license MIT
// ==/UserScript==
// this entire script was found on the web, I only edited the url it applies to
// Your code here...
var scriptCode = new Array();// this is where we are going to build our new script
// here's the build of the new script, one line at a time
scriptCode.push('function printAction(){');
scriptCode.push('url = \'scrPrint.jsp?mode=pataccactivity\'+');
scriptCode.push('\'&aspatid=\'+gsPtid+');
scriptCode.push('\'&poolname=\'+gPoolName+');
scriptCode.push('\'&outputmode=SCREEN\'+');
scriptCode.push('\'&printerselection=YES\';');
scriptCode.push('printDirect(url);');
scriptCode.push('}');
// now, we put the script in a new script element in the DOM
var script = document.createElement('script');// create the script element
script.innerHTML = scriptCode.join('\n');// add the script code to it
scriptCode.length = 0;// recover the memory we used to build the script
// this is sort of hard to read, because it's doing 2 things:
// 1. finds the first <head> tag on the page
// 2. adds the new script just before the </head> tag
document.getElementsByTagName('head')[0].appendChild(script);