Initial commit

This commit is contained in:
NohamR 2023-10-06 17:25:36 +02:00
commit 1e9670588c
27 changed files with 519 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

2
.gitattributes vendored Normal file
View File

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

32
background.js Normal file
View File

@ -0,0 +1,32 @@
// background.js
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if (request.updateBadge) {
chrome.action.setBadgeText({ text: request.badgeText });
chrome.action.setBadgeBackgroundColor({ color: [49, 102, 136, 255] });
setTimeout(function() {
chrome.action.setBadgeText({ text: '' }); // Clear the badge text
}, 4000);
}
});
chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
if (changeInfo.status === 'loading') {
// Check if the tab's URL matches your specified URLs
const matchesURL = /^https:\/\/(ent\.iledefrance\.fr|iledefrance\.fr)\//.test(tab.url);
// Update the icon based on whether the tab matches your specified URLs
chrome.action.setIcon({
tabId: tabId,
path: matchesURL ? {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
} : {
"16": "images/grey/icon16.png", // Greyed-out icon
"48": "images/grey/icon48.png", // Greyed-out icon
"128": "images/grey/icon128.png" // Greyed-out icon
}
});
}
});

26
content.js Normal file
View File

@ -0,0 +1,26 @@
function clickButton() {
const emailInput = document.getElementById("email");
const passwordInput = document.getElementById("password");
chrome.storage.local.get(['email', 'password'], function (data) {
if (data.email) {
if (emailInput) {
emailInput.value = data.email;
}
}
if (data.password) {
if (passwordInput) {
passwordInput.value = data.password;
}
}
const button = document.querySelector("button.flex-magnet-bottom-right");
if (button) {
button.click();
chrome.runtime.sendMessage({ updateBadge: true, badgeText: "+ 1" });
}
});
}
setInterval(clickButton, 1000);

20
dupe/custom.js Normal file
View File

@ -0,0 +1,20 @@
// custom.js
document.addEventListener('DOMContentLoaded', function () {
// Get a reference to the form and the button
const form = document.getElementById('loginForm');
const saveButton = document.getElementById('saveButton');
// Add an event listener to the button click event
saveButton.addEventListener('click', function (event) {
// Prevent the default form submission
event.preventDefault();
// You can add your custom logic here
// For example, you can validate the form inputs and perform other actions
// If you want to submit the form via AJAX, you can do that here.
// For demonstration purposes, let's just log a message
console.log('Form submission prevented.');
});
});

251
dupe/dupe.css Normal file

File diff suppressed because one or more lines are too long

79
dupe/dupe.html Normal file
View File

@ -0,0 +1,79 @@
<html desktop-device="" class="ng-scope portal-container">
<head>
<title>Configuration AutoEnt</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="dupe.css" id="theme" crossorigin="anonymous">
<link rel="icon" href="favicon.ico">
</head>
<body class="login ng-scope" ng-controller="LoginController" ng-init="error = &quot;&quot;; callBack = &quot;&quot;; mainPage = &quot;&quot;" style="width: 400px; height: 100px;">
<default-styles>
<div class="absolute">
<div ng-include="template.containers.main" class="ng-scope">
<div class="centered container row ng-scope">
<section class="main">
<div class="login panel"
ng-class="{'browser-container': !browser || (browser &amp;&amp; browser.outdated) || !cookieEnabled}">
<h1>
<i18n><span class="no-style ng-scope">AutoEnt</span></i18n>
</h1>
<div class="rigid-grid panels-container">
<!-- Use a form element with the CSS you want to keep -->
<form method="" class="ng-pristine ng-valid" id="loginForm">
<p>
<label>
<i18n><span class="no-style ng-scope">Identifiant</span></i18n>
</label>
<input type="text" ng-model="user.email" ng-keydown="noSpace($event)"
ng-change="noUpperCase()" name="email" id="email" autofocus="" tabindex="1"
class="ng-pristine ng-untouched ng-valid ng-empty">
</p>
<p>
<label>
<i18n><span class="no-style ng-scope">Mot de passe</span></i18n>
</label>
<input-password
class="ng-pristine ng-untouched ng-valid toggleable-password ng-scope ng-empty"><input
type="password" autocomplete="off" ng-model="user.password" name="password"
id="password" tabindex="2"
class="ng-pristine ng-untouched ng-valid ng-empty"></input-password>
</p>
<label>
<span class="no-style ng-scope">Se souviendra de toi</span></small>
</label>
<p></p>
<!-- Add a button to trigger your desired action -->
<button tabindex="3" class="flex-magnet-bottom-right" id="saveButton">
<i18n><span class="no-style ng-scope">Connexion</span></i18n>
</button>
</form>
</div>
</div>
</section>
</div>
</div>
</div>
</default-styles>
<div style="display: none;"></div>
</body>
<script src="popup.js"></script>
<script src="custom.js"></script>
<!-- <script>
// Get a reference to the form and the button
const form = document.getElementById('loginForm');
const saveButton = document.getElementById('saveButton');
// Add an event listener to the button click event
saveButton.addEventListener('click', function (event) {
// Prevent the default form submission
event.preventDefault();
// You can add your custom logic here
// For example, you can validate the form inputs and perform other actions
// If you want to submit the form via AJAX, you can do that here.
// For demonstration purposes, let's just log a message
console.log('Form submission prevented.');
});
</script> -->
</html>

BIN
dupe/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
dupe/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

27
dupe/popup.js Normal file
View File

@ -0,0 +1,27 @@
document.addEventListener('DOMContentLoaded', function () {
const emailInput = document.getElementById('email');
const passwordInput = document.getElementById('password');
const saveButton = document.getElementById('saveButton');
// Charger les valeurs précédemment enregistrées depuis le stockage local
chrome.storage.local.get(['email', 'password'], function (data) {
if (data.email) {
emailInput.value = data.email;
}
if (data.password) {
passwordInput.value = data.password;
}
});
// Enregistrer les valeurs lors du clic sur le bouton "Enregistrer"
saveButton.addEventListener('click', function () {
const email = emailInput.value;
const password = passwordInput.value;
// Enregistrer les valeurs dans le stockage local de l'extension
chrome.storage.local.set({ email, password }, function () {
// Fermer la fenêtre contextuelle après l'enregistrement
window.close();
});
});
});

BIN
images/.DS_Store vendored Normal file

Binary file not shown.

BIN
images/AutoEntIcon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
images/AutoEntIcon.psd Normal file

Binary file not shown.

BIN
images/grey/grey_image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/grey/icon128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/grey/icon16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

BIN
images/grey/icon32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/grey/icon48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/grey/icon64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
images/icon128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
images/icon16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

BIN
images/icon32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/icon48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
images/icon64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

38
manifest.json Normal file
View File

@ -0,0 +1,38 @@
{
"manifest_version": 3,
"name": "AutoEnt",
"version": "1.4",
"description": "Rempli l'id et mdp et clique sur connexion",
"permissions": ["activeTab", "storage"],
"host_permissions": [
"https://ent.iledefrance.fr/*",
"https://iledefrance.fr/*"
],
"content_scripts": [
{
"matches": [
"https://ent.iledefrance.fr/*",
"https://iledefrance.fr/*"
],
"js": ["content.js"]
}
],
"background": {
"service_worker": "background.js"
},
"action": {
// "default_popup": "temp/popup.html",
"default_popup": "dupe/dupe.html",
"default_icon": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"grey_icon": {
"16": "images/grey/icon16.png",
"48": "images/grey/icon48.png",
"128": "images/grey/icon128.png"
}
}
}

17
temp/popup.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Configuration AutoEnt</title>
</head>
<body>
<h2>Configuration AutoEnt</h2>
<label for="email">Adresse e-mail :</label>
<input type="text" id="email" placeholder="Saisissez votre e-mail"><br><br>
<label for="password">Mot de passe :</label>
<input type="password" id="password" placeholder="Saisissez votre mot de passe"><br><br>
<button id="saveButton">Enregistrer</button>
</body>
<script src="popup.js"></script>
</html>

27
temp/popup.js Normal file
View File

@ -0,0 +1,27 @@
document.addEventListener('DOMContentLoaded', function () {
const emailInput = document.getElementById('email');
const passwordInput = document.getElementById('password');
const saveButton = document.getElementById('saveButton');
// Charger les valeurs précédemment enregistrées depuis le stockage local
chrome.storage.local.get(['email', 'password'], function (data) {
if (data.email) {
emailInput.value = data.email;
}
if (data.password) {
passwordInput.value = data.password;
}
});
// Enregistrer les valeurs lors du clic sur le bouton "Enregistrer"
saveButton.addEventListener('click', function () {
const email = emailInput.value;
const password = passwordInput.value;
// Enregistrer les valeurs dans le stockage local de l'extension
chrome.storage.local.set({ email, password }, function () {
// Fermer la fenêtre contextuelle après l'enregistrement
window.close();
});
});
});