termsearch 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/frontend/dist/app.js +7 -2
- package/frontend/dist/style.css +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# TermSearch
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/termsearch)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
[](#)
|
package/frontend/dist/app.js
CHANGED
|
@@ -1180,11 +1180,12 @@ function renderApp() {
|
|
|
1180
1180
|
|
|
1181
1181
|
// ─── Homepage ─────────────────────────────────────────────────────────────
|
|
1182
1182
|
function addToBrowser() {
|
|
1183
|
+
let attemptedLegacyAdd = false;
|
|
1183
1184
|
// Try legacy Firefox API
|
|
1184
1185
|
try {
|
|
1185
1186
|
if (window.external?.AddSearchProvider) {
|
|
1187
|
+
attemptedLegacyAdd = true;
|
|
1186
1188
|
window.external.AddSearchProvider(location.origin + '/opensearch.xml');
|
|
1187
|
-
return;
|
|
1188
1189
|
}
|
|
1189
1190
|
} catch {}
|
|
1190
1191
|
// Show inline hint
|
|
@@ -1199,6 +1200,7 @@ function addToBrowser() {
|
|
|
1199
1200
|
urlBox.append(urlText, copyBtn);
|
|
1200
1201
|
const hint = el('div', { className: 'add-browser-hint' },
|
|
1201
1202
|
el('div', { className: 'add-browser-title' }, 'Add TermSearch to your browser'),
|
|
1203
|
+
attemptedLegacyAdd ? el('div', { className: 'add-browser-note' }, 'If no browser prompt appears, add it manually with the URL below.') : null,
|
|
1202
1204
|
el('div', { className: 'add-browser-steps' },
|
|
1203
1205
|
el('div', {}, el('span', { className: 'add-browser-badge' }, 'Firefox'), ' Address bar → click TermSearch icon → "Add"'),
|
|
1204
1206
|
el('div', {}, el('span', { className: 'add-browser-badge' }, 'Chrome'), ' Settings → Search engine → Manage → Add'),
|
|
@@ -1207,7 +1209,10 @@ function addToBrowser() {
|
|
|
1207
1209
|
el('div', { className: 'add-browser-label' }, 'Search URL (paste in browser settings):'),
|
|
1208
1210
|
urlBox,
|
|
1209
1211
|
);
|
|
1210
|
-
document.querySelector('.footer')
|
|
1212
|
+
const footer = document.querySelector('.footer');
|
|
1213
|
+
if (footer) footer.before(hint);
|
|
1214
|
+
else document.getElementById('app')?.append(hint);
|
|
1215
|
+
hint.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
1211
1216
|
setTimeout(() => hint.remove(), 20000);
|
|
1212
1217
|
}
|
|
1213
1218
|
|
package/frontend/dist/style.css
CHANGED
|
@@ -1005,6 +1005,11 @@ a:hover { color: var(--link-h); }
|
|
|
1005
1005
|
color: var(--text);
|
|
1006
1006
|
margin-bottom: 10px;
|
|
1007
1007
|
}
|
|
1008
|
+
.add-browser-note {
|
|
1009
|
+
margin-bottom: 10px;
|
|
1010
|
+
font-size: 11px;
|
|
1011
|
+
color: #c4b5fd;
|
|
1012
|
+
}
|
|
1008
1013
|
.add-browser-steps {
|
|
1009
1014
|
display: flex;
|
|
1010
1015
|
flex-direction: column;
|