use hostname, add close button to frame
This commit is contained in:
parent
e227f9aaf7
commit
caea4f90fd
@ -82,7 +82,7 @@ async function injectForeground() {
|
|||||||
const parsed = new URL(tab.url);
|
const parsed = new URL(tab.url);
|
||||||
|
|
||||||
askNative({
|
askNative({
|
||||||
domain: parsed.host,
|
domain: parsed.hostname,
|
||||||
}).then(({ results }) => {
|
}).then(({ results }) => {
|
||||||
if (results && results.length) {
|
if (results && results.length) {
|
||||||
currentPageMatches = results;
|
currentPageMatches = results;
|
||||||
|
@ -161,6 +161,27 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
autoFillContainer.appendChild(select);
|
autoFillContainer.appendChild(select);
|
||||||
|
|
||||||
|
const close = document.createElement('button');
|
||||||
|
close.innerText = 'close';
|
||||||
|
Object.assign(close.style, {
|
||||||
|
right: '0',
|
||||||
|
border: '0',
|
||||||
|
position: 'absolute',
|
||||||
|
padding: '0 4px',
|
||||||
|
appearance: 'none',
|
||||||
|
background: 'transparent',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontSize: '12px',
|
||||||
|
pointerEvents: 'all'
|
||||||
|
});
|
||||||
|
autoFillContainer.appendChild(close);
|
||||||
|
|
||||||
|
close.addEventListener('click', () => {
|
||||||
|
autoFillContainer.parentElement.removeChild(autoFillContainer);
|
||||||
|
window.removeEventListener('resize', reposition);
|
||||||
|
window.removeEventListener('scroll', reposition);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user