mirror of
https://github.com/NohamR/AutoEnt.git
synced 2026-01-10 07:48:13 +00:00
publish
This commit is contained in:
@@ -1,20 +1,9 @@
|
||||
// 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.');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,22 +58,4 @@
|
||||
</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>
|
||||
|
||||
@@ -3,7 +3,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
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;
|
||||
@@ -13,14 +12,11 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
}
|
||||
});
|
||||
|
||||
// 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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user