You can achieve the same result with a user script. It won't prevent the external JavaScript from loading, but it will disable the JavaScript functions alert()
and confirm()
. Removing the banner with JavaScript could cause flickering, but you can inject CSS to hide it.
User script
// ==UserScript==
// @name No Nagging
// @description Disables nagging on harrison.edu
// @version 1.2
// @include *://harrison.edu/*
// @include *://*.harrison.edu/*
// @run-at document-start
// ==/UserScript==
var script = document.createElement('script');
var style = document.createElement('style');
script.appendChild(document.createTextNode(
'window.alert=function(){};' +
'window.confirm=function(){};'
));
style.appendChild(document.createTextNode(
'.topmenubar{display:none;}'
));
var interval = setInterval(function() {
if (document.head) {
document.head.appendChild(script);
document.head.appendChild(style);
clearInterval(interval);
}
}, 10);
How it works
The first four instructions create <script>
and <style>
elements. The JavaScript inside <script>
replaces the global functions alert()
and confirm()
with empty functions; the CSS inside <style>
hides the banner.
<script>
window.alert=function(){};
window.confirm=function(){};
</script>
<style>
.topmenubar{display:none;}
</style>
Next, we create an interval that checks every 10 ms in the <head>
element already exists.
When it does, we append the created elements to <head>
and cancel the interval.
How to install
Save the script as no-nagging.user.js
.
-
OR
Close Chrome and reopen it by executing the following command:
google-chrome --easy-off-store-extension-install
Drag no-nagging.user.js
into the address bar.
Click Add.
Can you post a link to that page? – Dennis – 2013-02-13T23:57:07.487
@Dennis https://myharrison.harrison.edu/secure/student/loginstu.aspx
– killermist – 2013-02-14T00:56:46.803