-
Notifications
You must be signed in to change notification settings - Fork 10
Showing an error message on invalid URLs #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
}, function () { | ||
if (chrome.runtime.lastError) { | ||
switch (chrome.runtime.lastError.message) { | ||
case "Cannot access a chrome:// URL": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find error code in the chrome.runtime.lastError
. Let me know if there is a better way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine. However, I don't see the need for both an if
and a switch
here. Maybe you can do some refactoring?
@@ -58,7 +58,11 @@ | |||
</head> | |||
<body> | |||
<div class="heading"><p>aims helper<p></div> | |||
<p class="status" style="display: none">You are not on the AIMS Page. </p> <!-- Replace with JS checker later. --> | |||
<p class="status" id="error-message" style="display: none;">You are probably not on the appropriate AIMS page. Goto <a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove "probably". Add "please" before Goto.
@@ -1,4 +1,9 @@ | |||
function activate() { | |||
|
|||
if (!(document.location.href === "https://aims.iith.ac.in/aims/courseReg/studentRegForm/44")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This URL may very well change, so use a constant variable here.
Fixes #5