-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from passwall/main
add fill button to login detail
- Loading branch information
Showing
17 changed files
with
253 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,67 @@ | ||
const browser = require('webextension-polyfill') | ||
|
||
browser.runtime.onMessage.addListener(function(request, sender, sendResponse) { | ||
console.log('Hello from the background') | ||
console.log(browser) | ||
}) | ||
/* // Login Hashmap | ||
let loginHashmap = new Map() | ||
// Listener | ||
browser.runtime.onMessage.addListener(handleMessage); | ||
// Handler | ||
function handleMessage(request, sender, sendResponse) { | ||
let status = "No new record" | ||
// Create new record | ||
if ((typeof request.username !== 'undefined') && (typeof request.password !== 'undefined')) { | ||
let url = domainFromUrl(sender.tab.url); | ||
let key = url + ":" + request.username; | ||
if (!loginHashmap.has(key)) { | ||
loginHashmap.set(key, { | ||
title: sender.tab.title, | ||
url: url, | ||
username: request.username, | ||
password: request.password, | ||
}); | ||
status = "New record added"; | ||
} | ||
} | ||
sendResponse({ | ||
response: status, | ||
}); | ||
} | ||
//onUpdated listener fired when a tab URL is changed | ||
browser.tabs.onUpdated.addListener(handleUpdated); | ||
function handleUpdated(tabId, changeInfo, tabInfo) { | ||
let url = domainFromUrl(tabInfo.url); | ||
console.log(url); | ||
// Bu üçü de sistemde yoksa yeni login aç | ||
// url : sender.tab.url, | ||
// username: request.username, | ||
// password: request.password, | ||
// Bu üçü de sistemde var ve aynıysa hiç popup çıkarma | ||
// url ve username ayni ve parola farkliysa update olmali | ||
if (tabInfo.active) { | ||
// console.log(`handleUpdates : ${tabInfo.url}`); | ||
} | ||
// if (loginHashmap.has(tabInfo.url)) { | ||
// console.log(loginHashmap.get(tabInfo.url)) | ||
// } | ||
} | ||
function domainFromUrl(url) { | ||
const matches = url.match(/^(?:https?:)?(?:\/\/)?([^\/\?]+)/i) | ||
return matches ? matches[1] : 'NONE' | ||
} */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,46 @@ | ||
const browser = require('webextension-polyfill') | ||
|
||
console.log('Hello from the content-script') | ||
console.log(browser) | ||
// CATCHER | ||
let inputs = document.querySelectorAll('input'), i; | ||
let username = ""; | ||
let password = ""; | ||
|
||
for (i = 0; i < inputs.length; ++i) { | ||
|
||
// Find password | ||
if (inputs[i].type === "password") { | ||
password = inputs[i]; | ||
|
||
// Find username. Check type against type hidden or checkbox etc. | ||
for (var k = i; k >= 0; k--) { | ||
if (inputs[k].type == "text") { | ||
username = inputs[k]; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// Listen and send data to fill hashmap in the background | ||
/* if (password !== "" && username !== "") { | ||
password.addEventListener('blur', function () { | ||
let login = browser.runtime.sendMessage({ | ||
username: username.value, | ||
password: password.value, | ||
}); | ||
login.then(handleResponse, handleError); | ||
}); | ||
} | ||
function handleResponse(message) { console.log(`Response: ${message.response}`); } | ||
function handleError(error) { console.log(`Error: ${error}`); } */ | ||
|
||
// FILLER | ||
// Sender is in /src/popup/views/Logins/detail.vue | ||
browser.runtime.onMessage.addListener((request, sender) => { | ||
username.style.borderColor = "#5707FF"; | ||
password.style.borderColor = "#5707FF"; | ||
|
||
username.value = request.msg.username; | ||
password.value = request.msg.password; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<template> | ||
<h1>options page</h1> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
created() { | ||
this.$storage.getItem('email').then(console.log) | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
html, | ||
body { | ||
background-color: $color-gray-500; | ||
scrollbar-width: none; /* Firefox */ | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Vue from 'vue' | ||
import App from './App.vue' | ||
|
||
import '../styles/app.scss' | ||
|
||
import storage from '@/utils/storage' | ||
Vue.prototype.$storage = storage | ||
|
||
/* eslint-disable no-new */ | ||
new Vue({ | ||
el: '#app', | ||
render: h => h(App) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ | |
v-model="form.extra" | ||
label="Extra" | ||
name="extra" | ||
isEditable | ||
/> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.