Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions content_otp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$(window).on("load", () => {
chrome.storage.sync.get(['otp'], function (items) {
var totp = new jsOTP.totp();
var otpValue = totp.getOtp(items['otp']);
setTimeout(() => {
$('.form-control').val(otpValue);
}, 100);
setTimeout(() => {
if ($('.btn-primary')[0])
$('.btn-primary')[0].click()
}, 200);
});
});
8 changes: 4 additions & 4 deletions content_security.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
$(window).on("load", () => {
chrome.storage.sync.get(['q1', 'a1', 'q2', 'a2', 'q3', 'a3', 'q4', 'a4'], function (items) {
setTimeout(() => {
if ($('strong')[0].innerText == '\"'+items['q1']+'\"') {
if ($('strong')[0].innerText == '\"' + items['q1'] + '\"') {
$('#answer').val(items['a1']);
} else if ($('strong')[0].innerText == '\"'+items['q2']+'\"') {
} else if ($('strong')[0].innerText == '\"' + items['q2'] + '\"') {
$('#answer').val(items['a2']);
} else if ($('strong')[0].innerText == '\"'+items['q3']+'\"') {
} else if ($('strong')[0].innerText == '\"' + items['q3'] + '\"') {
$('#answer').val(items['a3']);
} else if ($('strong')[0].innerText == '\"'+items['q4']+'\"') {
} else if ($('strong')[0].innerText == '\"' + items['q4'] + '\"') {
$('#answer').val(items['a4']);
}
}, 100);
Expand Down
7 changes: 7 additions & 0 deletions jsOTP.min.js

Large diffs are not rendered by default.

38 changes: 17 additions & 21 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"name": "GCKey-IRCC Login Automation",
"description": "Chrome Extension for GCKey-IRCC Login Automation",
"version": "1.0",
"permissions": [
"storage"
],
"host_permissions" : [
"permissions": ["storage"],
"host_permissions": [
"https://clegc-gckey.gc.ca/*",
"https://www.canada.ca/en/immigration-refugees-citizenship/services/application/account.html",
"https://onlineservices-servicesenligne.cic.gc.ca/mycic/termsAndConditions",
"https://onlineservices-servicesenligne.cic.gc.ca/mycic/askSecurityQuestion"
"https://onlineservices-servicesenligne.cic.gc.ca/mycic/askSecurityQuestion",
"https://mfa.auth.canada.ca/mfaui/l/authenticate",
"https://mfa.auth.canada.ca/mfaui/account"
],
"action": {
"default_icon": {
Expand All @@ -25,29 +25,25 @@
"matches": [
"https://www.canada.ca/en/immigration-refugees-citizenship/services/application/account.html"
],
"js": [
"jquery-3.1.0.min.js",
"content_gckey_init.js"
]
"js": ["jquery-3.1.0.min.js", "content_gckey_init.js"]
},
{
"matches": [
"https://clegc-gckey.gc.ca/*"
],
"js": [
"jquery-3.1.0.min.js",
"content_login.js"
]
"matches": ["https://clegc-gckey.gc.ca/*"],
"js": ["jquery-3.1.0.min.js", "content_login.js"]
},
{
"matches": [
"https://onlineservices-servicesenligne.cic.gc.ca/mycic/termsAndConditions",
"https://onlineservices-servicesenligne.cic.gc.ca/mycic/askSecurityQuestion"
],
"js": [
"jquery-3.1.0.min.js",
"content_security.js"
]
"js": ["jquery-3.1.0.min.js", "content_security.js"]
},
{
"matches": [
"https://mfa.auth.canada.ca/mfaui/l/authenticate*",
"https://mfa.auth.canada.ca/mfaui/account*"
],
"js": ["jquery-3.1.0.min.js", "jsOTP.min.js", "content_otp.js"]
}
],
"icons": {
Expand All @@ -57,4 +53,4 @@
"64": "images/icons/64.png",
"128": "images/icons/128.png"
}
}
}
88 changes: 48 additions & 40 deletions options.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>GCKey-IRCC Check</title>
<script src="jquery-3.1.0.min.js"></script>
<script src="jsOTP.min.js"></script>
<script src="options.js"></script>
</head>

<head>
<title>GCKey-IRCC Check</title>
<script src="jquery-3.1.0.min.js"></script>
<script src="options.js"></script>
</head>

<body>
<h1>GCKey-IRCC Login Automation</h1>
<h3>User ID: <input type="text" id="id" /></h3>
<h3>Password: <input type="password" id="pass" /></h3>
<br>
<h4>Question 1: <input type="text" id="q1" /></h4>
<h4>Answer of Q1: <input type="password" id="a1" /></h4>
<br>
<h4>Question 2: <input type="text" id="q2" /></h4>
<h4>Answer of Q2: <input type="password" id="a2" /></h4>
<br>
<h4>Question 3: <input type="text" id="q3" /></h4>
<h4>Answer of Q3: <input type="password" id="a3" /></h4>
<br>
<h4>Question 4: <input type="text" id="q4" /></h4>
<h4>Answer of Q4: <input type="password" id="a4" /></h4>
<br>
<button type="submit" id="save">SAVE</button>
<span id="saved" style="color: gray;" hidden="true">Saved!</span>
<span id="error" style="color: red;" hidden="true">All fields are not filled</span>
<!-- <button>Cancel</button> -->
<br><br>
<h5>All data above is case sensitive and is stored locally.</h5><br>
<p>
Note: This extension might not function properly until all the fields on the options page are filled correctly and saved. <br>
The extension will not be maintained. Therefore, it is possible that it stops working if IRCC changes the GCKey
login pages/process.</p>
<p>
Disclaimer: This extension comes with no warranty. The only use of this exetension is to automate login on the
GCKey Website. Please take care of your login information. The developer is not responsible for any loss of your
personal data/information or any problems you might face. Please use this at your own risk.</p>
</body>

</html>
<body>
<h1>GCKey-IRCC Login Automation</h1>
<h3>User ID: <input type="text" id="id" /></h3>
<h3>Password: <input type="password" id="pass" /></h3>
<br />
<h4>Question 1: <input type="text" id="q1" /></h4>
<h4>Answer of Q1: <input type="password" id="a1" /></h4>
<br />
<h4>Question 2: <input type="text" id="q2" /></h4>
<h4>Answer of Q2: <input type="password" id="a2" /></h4>
<br />
<h4>Question 3: <input type="text" id="q3" /></h4>
<h4>Answer of Q3: <input type="password" id="a3" /></h4>
<br />
<h4>Question 4: <input type="text" id="q4" /></h4>
<h4>Answer of Q4: <input type="password" id="a4" /></h4>
<br />
<h4>OTP: <input type="text" id="otp" /></h4>
<button type="submit" id="save">SAVE</button>
<span id="saved" style="color: gray" hidden="true">Saved!</span>
<span id="error" style="color: red" hidden="true"
>All fields are not filled</span
>
<!-- <button>Cancel</button> -->
<br /><br />
<h5>All data above is case sensitive and is stored locally.</h5>
<br />
<p>
Note: This extension might not function properly until all the
fields on the options page are filled correctly and saved. <br />
The extension will not be maintained. Therefore, it is possible that
it stops working if IRCC changes the GCKey login pages/process.
</p>
<p>
Disclaimer: This extension comes with no warranty. The only use of
this exetension is to automate login on the GCKey Website. Please
take care of your login information. The developer is not
responsible for any loss of your personal data/information or any
problems you might face. Please use this at your own risk.
</p>
</body>
</html>
9 changes: 6 additions & 3 deletions options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$(window).on("load", () => {
chrome.storage.sync.get(['id', 'pass', 'q1', 'a1', 'q2', 'a2', 'q3', 'a3', 'q4', 'a4'], function (items) {
chrome.storage.sync.get(['id', 'pass', 'q1', 'a1', 'q2', 'a2', 'q3', 'a3', 'q4', 'a4', 'otp'], function (items) {
$('#id').val(items['id']);
$('#pass').val(items['pass']);
$('#q1').val(items['q1']);
Expand All @@ -10,6 +10,7 @@ $(window).on("load", () => {
$('#a3').val(items['a3']);
$('#q4').val(items['q4']);
$('#a4').val(items['a4']);
$('#otp').val(items['otp']);
})
})

Expand All @@ -27,7 +28,8 @@ $(function () {
$('#q3').val() == '' ||
$('#a3').val() == '' ||
$('#q4').val() == '' ||
$('#a4').val() == ''
$('#a4').val() == '' ||
$('#otp').val() == ''
) {
$("#error").attr("hidden", false);
}
Expand All @@ -43,7 +45,8 @@ $(function () {
'q3': $('#q3').val(),
'a3': $('#a3').val(),
'q4': $('#q4').val(),
'a4': $('#a4').val()
'a4': $('#a4').val(),
'otp': $('#otp').val()
}
);
$("#saved").attr("hidden", false);
Expand Down