Update Compass QoL Enhancer to 1.1.0
- Prevent a Uncaught TypeError: unsafeWindow.CKEDITOR is undefined from showing - Uncheck the Remember Me box by default
This commit is contained in:
parent
c35511a219
commit
67cb1e9072
|
@ -2,7 +2,7 @@
|
||||||
// @name Compass QoL Enhancer
|
// @name Compass QoL Enhancer
|
||||||
// @namespace blankie-scripts
|
// @namespace blankie-scripts
|
||||||
// @match http*://*.compass.education/*
|
// @match http*://*.compass.education/*
|
||||||
// @version 1.0.0
|
// @version 1.1.0
|
||||||
// @author blankie
|
// @author blankie
|
||||||
// @description A userscript that adds small but useful features for Compass, such as the ability to close windows by clicking on the background
|
// @description A userscript that adds small but useful features for Compass, such as the ability to close windows by clicking on the background
|
||||||
// @inject-into page
|
// @inject-into page
|
||||||
|
@ -107,10 +107,18 @@ function handleActivityTabClick(element) {
|
||||||
// Suppress that annoying barebones context menu that only has Copy
|
// Suppress that annoying barebones context menu that only has Copy
|
||||||
// why is it not obvious that you can just hold ctrl or shift to suppress it???
|
// why is it not obvious that you can just hold ctrl or shift to suppress it???
|
||||||
// i know it's compass' fault but i'm still frustrated
|
// i know it's compass' fault but i'm still frustrated
|
||||||
// https://stackoverflow.com/a/10815581
|
// unsafeWindow.CKEDITOR may not be set if you're on the login page, for example
|
||||||
let originalOn = unsafeWindow.CKEDITOR.dom.domObject.prototype.on;
|
if (unsafeWindow.CKEDITOR) {
|
||||||
unsafeWindow.CKEDITOR.dom.domObject.prototype.on = function(type, listener) {
|
let originalOn = unsafeWindow.CKEDITOR.dom.domObject.prototype.on;
|
||||||
|
unsafeWindow.CKEDITOR.dom.domObject.prototype.on = function(type, listener) {
|
||||||
|
// https://stackoverflow.com/a/10815581
|
||||||
if (type !== "contextmenu") {
|
if (type !== "contextmenu") {
|
||||||
return originalOn.apply(this, arguments);
|
return originalOn.apply(this, arguments);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uncheck the Remember Me button by default
|
||||||
|
if (window.location.pathname === "/login.aspx") {
|
||||||
|
document.querySelector("#rememberMeChk").checked = false;
|
||||||
|
}
|
|
@ -25,6 +25,7 @@ A userscript that adds small but useful features for Compass. Features include:
|
||||||
- `&openLearningTaskTab` is automatically added whenever you go to the Learning
|
- `&openLearningTaskTab` is automatically added whenever you go to the Learning
|
||||||
Tasks tab and removed whenever you go to another tab
|
Tasks tab and removed whenever you go to another tab
|
||||||
- The context menu that only says "Copy" is now suppressed
|
- The context menu that only says "Copy" is now suppressed
|
||||||
|
- The option to remember logins is unchecked by default
|
||||||
|
|
||||||
## Elements with ID lister
|
## Elements with ID lister
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue