code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
constructor() {
this.sync = createSyncedOptions();
this.local = new BrowserStorage(browser.storage.local, {
lastQueryUrl: null,
lastFocusedIndex: 0,
});
} | @param {StorageArea} storage The storage area to which this section will
write.
@param {Object} defaultValues The default options.
@constructor | constructor | javascript | infokiller/web-search-navigator | src/options.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options.js | MIT |
load() {
return Promise.all([this.local.load(), this.sync.load()]);
} | @param {StorageArea} storage The storage area to which this section will
write.
@param {Object} defaultValues The default options.
@constructor | load | javascript | infokiller/web-search-navigator | src/options.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options.js | MIT |
setSearchEnginePermission_ = async (checkbox) => {
const urls = OPTIONAL_PERMISSIONS_URLS[checkbox.id];
if (checkbox.checked) {
checkbox.checked = false;
const granted = await browser.permissions.request({origins: urls});
checkbox.checked = granted;
} else {
browser.permissions.remove({origins: ur... | Add other search engines domain on user input
@param {Element} checkbox | setSearchEnginePermission_ | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
setSearchEnginePermission_ = async (checkbox) => {
const urls = OPTIONAL_PERMISSIONS_URLS[checkbox.id];
if (checkbox.checked) {
checkbox.checked = false;
const granted = await browser.permissions.request({origins: urls});
checkbox.checked = granted;
} else {
browser.permissions.remove({origins: ur... | Add other search engines domain on user input
@param {Element} checkbox | setSearchEnginePermission_ | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
async init() {
await this.loadOptions();
const braveSearch = document.getElementById('brave-search');
braveSearch.addEventListener('change', () => {
setSearchEnginePermission_(braveSearch);
});
const startpage = document.getElementById('startpage');
startpage.addEventListener('change', () ... | Add other search engines domain on user input
@param {Element} checkbox | init | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
async saveOptions() {
const getOpt = (key) => {
return this.options.get(key);
};
const setOpt = (key, value) => {
this.options.set(key, value);
};
// Handle non-keybindings settings first
setOpt(
'wrapNavigation',
document.getElementById('wrap-navigation').checked,
... | Add other search engines domain on user input
@param {Element} checkbox | saveOptions | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
getOpt = (key) => {
return this.options.get(key);
} | Add other search engines domain on user input
@param {Element} checkbox | getOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
getOpt = (key) => {
return this.options.get(key);
} | Add other search engines domain on user input
@param {Element} checkbox | getOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
setOpt = (key, value) => {
this.options.set(key, value);
} | Add other search engines domain on user input
@param {Element} checkbox | setOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
setOpt = (key, value) => {
this.options.set(key, value);
} | Add other search engines domain on user input
@param {Element} checkbox | setOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
loadSearchEnginePermissions_(permissions) {
// Check what URLs we have permission for.
const braveSearch = document.getElementById('brave-search');
braveSearch.checked = OPTIONAL_PERMISSIONS_URLS['brave-search'].every(
(url) => {
return permissions.origins.includes(url);
},
);
... | Add other search engines domain on user input
@param {Element} checkbox | loadSearchEnginePermissions_ | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
async loadOptions() {
this.options = createSyncedOptions();
const [, permissions] = await Promise.all([
this.options.load(),
browser.permissions.getAll(),
]);
this.loadSearchEnginePermissions_(permissions);
const getOpt = (key) => {
return this.options.get(key);
};
// Handl... | Add other search engines domain on user input
@param {Element} checkbox | loadOptions | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
getOpt = (key) => {
return this.options.get(key);
} | Add other search engines domain on user input
@param {Element} checkbox | getOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
getOpt = (key) => {
return this.options.get(key);
} | Add other search engines domain on user input
@param {Element} checkbox | getOpt | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
async resetToDefaults() {
try {
await this.options.clear();
await this.loadOptions();
this.flashMessage('Options set to defaults');
} catch (e) {
this.flashMessage('Error when setting options to defaults');
}
} | Add other search engines domain on user input
@param {Element} checkbox | resetToDefaults | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
flashMessage(message) {
// Update status to let user know.
const status = document.getElementById('status');
status.textContent = message;
setTimeout(() => {
status.textContent = '';
}, 3000);
} | Add other search engines domain on user input
@param {Element} checkbox | flashMessage | javascript | infokiller/web-search-navigator | src/options_page.js | https://github.com/infokiller/web-search-navigator/blob/master/src/options_page.js | MIT |
constructor(
element,
anchorSelector,
highlightClass,
highlightedElementSelector,
containerSelector,
) {
this.#element = element;
this.#anchorSelector = anchorSelector;
this.highlightClass = highlightClass;
this.#highlightedElementSelector = highlightedElementSelector;
... | @param {Element} element
@param {function|null} anchorSelector
@param {string} highlightClass
@param {function|null} highlightedElementSelector
@param {function|null} containerSelector | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get anchor() {
if (!this.#anchorSelector) {
return this.#element;
}
return this.#anchorSelector(this.#element);
} | @param {Element} element
@param {function|null} anchorSelector
@param {string} highlightClass
@param {function|null} highlightedElementSelector
@param {function|null} containerSelector | anchor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get container() {
if (!this.#containerSelector) {
return this.#element;
}
return this.#containerSelector(this.#element);
} | @param {Element} element
@param {function|null} anchorSelector
@param {string} highlightClass
@param {function|null} highlightedElementSelector
@param {function|null} containerSelector | container | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get highlightedElement() {
if (!this.#highlightedElementSelector) {
return this.#element;
}
return this.#highlightedElementSelector(this.#element);
} | @param {Element} element
@param {function|null} anchorSelector
@param {string} highlightClass
@param {function|null} highlightedElementSelector
@param {function|null} containerSelector | highlightedElement | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSortedSearchResults = (
includedSearchResults,
excludedNodeList = [],
) => {
const excludedResultsSet = new Set();
for (const node of excludedNodeList) {
excludedResultsSet.add(node);
}
const searchResults = [];
for (const results of includedSearchResults) {
for (const node of results.nodes... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getSortedSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSortedSearchResults = (
includedSearchResults,
excludedNodeList = [],
) => {
const excludedResultsSet = new Set();
for (const node of excludedNodeList) {
excludedResultsSet.add(node);
}
const searchResults = [];
for (const results of includedSearchResults) {
for (const node of results.nodes... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getSortedSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getFixedSearchBoxTopMargin = (searchBoxContainer, element) => {
// When scrolling down, the search box can have a fixed position and can hide
// search results, so we try to compensate for it.
if (!searchBoxContainer || searchBoxContainer.contains(element)) {
return 0;
}
return searchBoxContainer.getBound... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getFixedSearchBoxTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getFixedSearchBoxTopMargin = (searchBoxContainer, element) => {
// When scrolling down, the search box can have a fixed position and can hide
// search results, so we try to compensate for it.
if (!searchBoxContainer || searchBoxContainer.contains(element)) {
return 0;
}
return searchBoxContainer.getBound... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getFixedSearchBoxTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
isFirefox = () => {
return navigator.userAgent.toLowerCase().indexOf('firefox') >= 0;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | isFirefox | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
isFirefox = () => {
return navigator.userAgent.toLowerCase().indexOf('firefox') >= 0;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | isFirefox | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getDefaultBottomMargin = (element) => {
return 28;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getDefaultBottomMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getDefaultBottomMargin = (element) => {
return 28;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getDefaultBottomMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
selectorElementGetter = (selector) => {
return () => {
return document.querySelector(selector);
};
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | selectorElementGetter | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
selectorElementGetter = (selector) => {
return () => {
return document.querySelector(selector);
};
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | selectorElementGetter | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nParent = (element, n) => {
while (n > 0 && element) {
element = element.parentElement;
n--;
}
return element;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nParent | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nParent = (element, n) => {
while (n > 0 && element) {
element = element.parentElement;
n--;
}
return element;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nParent | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
debounce = (callback, delayMs) => {
let timeoutId;
return (...args) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
return callback(...args);
}, delayMs);
};
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | debounce | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
debounce = (callback, delayMs) => {
let timeoutId;
return (...args) => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
return callback(...args);
}, delayMs);
};
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | debounce | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/(www\.)?google\./;
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
// Must match search engine search box
// NOTE: we used '#searchform input[name=q]' before 2020-06-05 but that
// doesn't work in the images search tab. Another option is to use
// 'input[role="combobox"]' but this doesn't work when there's also a
// dictionary search box.
... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getTopMargin(element) {
return getFixedSearchBoxTopMargin(
document.querySelector('#searchform.minidiv'),
element,
);
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getBottomMargin(element) {
return isFirefox() ? 0 : getDefaultBottomMargin();
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getBottomMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
onChangedResults(callback) {
if (GoogleSearch.#isImagesTab()) {
return GoogleSearch.#onImageSearchResults(callback);
}
if (this.options.googleIncludeMemex) {
return GoogleSearch.#onMemexResults(callback);
}
// https://github.com/infokiller/web-search-navigator/issues/464
const contai... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | onChangedResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nearestChildOrSiblingOrParentAnchor = (element) => {
const childAnchor = element.querySelector('a');
if (childAnchor && childAnchor.href) {
return childAnchor;
}
const siblingAnchor = element.parentElement.querySelector('a');
if (siblingAnchor && siblingAnchor.href) {
retur... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nearestChildOrSiblingOrParentAnchor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nearestChildOrSiblingOrParentAnchor = (element) => {
const childAnchor = element.querySelector('a');
if (childAnchor && childAnchor.href) {
return childAnchor;
}
const siblingAnchor = element.parentElement.querySelector('a');
if (siblingAnchor && siblingAnchor.href) {
retur... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nearestChildOrSiblingOrParentAnchor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nearestCardContainer = (element) => {
return element.closest('g-inner-card');
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nearestCardContainer | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
nearestCardContainer = (element) => {
return element.closest('g-inner-card');
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nearestCardContainer | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
if (GoogleSearch.#isImagesTab()) {
return GoogleSearch.#getImagesTabResults();
}
const includedElements = GoogleSearch.#regularResults();
if (this.options.googleIncludeCards) {
includedElements.push(...GoogleSearch.#cardResults());
}
if (this.options.googleInclud... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get previousPageButton() {
if (GoogleSearch.#isImagesTab()) {
return null;
}
return selectorElementGetter('#pnprev');
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | previousPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get nextPageButton() {
if (GoogleSearch.#isImagesTab()) {
return null;
}
return selectorElementGetter('#pnnext');
} | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | nextPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get tabs() {
if (GoogleSearch.#isImagesTab()) {
return GoogleSearch.#imageSearchTabs();
}
return {
navigateSearchTab: selectorElementGetter(
// eslint-disable-next-line max-len
'a[href*="/search?q="]:not([href*="&tbm="]):not([href*="maps.google."])',
),
navigateIm... | @param {Array} includedSearchResults An array of
tuples. Each tuple contains collection of the search results optionally
accompanied with their container selector.
@constructor | tabs | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
changeTools(period) {
const searchParams = new URLSearchParams(window.location.search);
// Use the last value of the tbs param in case there are multiple ones,
// since the last one overrides the previous ones.
const allTbsValues = searchParams.getAll('tbs');
const lastTbsValue = allTbsValues[allTbs... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | changeTools | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
changeImageSize(size) {
const sizeOptions = {
LARGE: {value: 0, name: 'Large', code: 'l'},
MEDIUM: {value: 1, name: 'Medium', code: 'e'},
ICON: {value: 2, name: 'Icon', code: 'i'},
};
const openTool = document.querySelector(
'[class="PNyWAd ZXJQ7c"][jsname="I4bIT"]',
);
if ... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | changeImageSize | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getButton = (selector) => {
let button;
if (document.querySelector(selector) != null) {
button = document.querySelector(selector);
} else {
button = null;
}
return button;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getButton = (selector) => {
let button;
if (document.querySelector(selector) != null) {
button = document.querySelector(selector);
} else {
button = null;
}
return button;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
setImageSize = (dropDownWithSize, buttonSelector) => {
let button = getButton(buttonSelector);
if (dropDownWithSize == null && button != null) {
button.click();
} else if (dropDownWithSize != null && button == null) {
dropDownWithSize.click();
button = getButton(buttonSelector)... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | setImageSize | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
setImageSize = (dropDownWithSize, buttonSelector) => {
let button = getButton(buttonSelector);
if (dropDownWithSize == null && button != null) {
button.click();
} else if (dropDownWithSize != null && button == null) {
dropDownWithSize.click();
button = getButton(buttonSelector)... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | setImageSize | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/search\.brave\.com/;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
return '.form-input, input[id=searchbox]';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getTopMargin(element) {
return getFixedSearchBoxTopMargin(
document.querySelector('header.navbar'),
element,
);
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
onChangedResults(callback) {
const containers = document.querySelectorAll('#results');
const observer = new MutationObserver(
debounce((mutationsList, observer) => {
callback(true);
}, 50),
);
for (const container of containers) {
observer.observe(container, {
att... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | onChangedResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
if (BraveSearch.#isTabActive(this.tabs.navigateNewsTab)) {
return BraveSearch.#getNewsTabResults();
} else if (BraveSearch.#isTabActive(this.tabs.navigateVideosTab)) {
return BraveSearch.#getVideosTabResults();
}
const includedElements = [
{
nodes: documen... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get tabs() {
return {
navigateSearchTab: document.querySelector('a[href*="/search?q="]'),
navigateImagesTab: document.querySelector(
'#tab-images > a:first-of-type',
),
navigateNewsTab: document.querySelector('a[href*="/news?q="]'),
navigateVideosTab: document.querySelector(
... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | tabs | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/(www\.)?startpage\./;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
return '#q';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getTopMargin(element) {
return getFixedSearchBoxTopMargin(
document.querySelector('div.layout-web__header'),
element,
);
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getBottomMargin(element) {
// Startpage in Firefox has an issue where trying to scroll can result in
// window.scrollY being updated for a brief time although no scrolling is
// done, which confuses the scrollToElement function, which can lead to
// being stuck focused on a search result.
return isF... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getBottomMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
// Don't initialize results navigation on image search, since it doesn't
// work there.
if (StartPage.#isImagesTab()) {
return [];
}
const containerSelector = (element) => {
if (StartPage.#isSearchTab()) {
return element.closest('.w-gl__result');
}
... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
containerSelector = (element) => {
if (StartPage.#isSearchTab()) {
return element.closest('.w-gl__result');
}
return element;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | containerSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
containerSelector = (element) => {
if (StartPage.#isSearchTab()) {
return element.closest('.w-gl__result');
}
return element;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | containerSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get previousPageButton() {
const menuLinks = document.querySelectorAll('.inline-nav-menu__link');
if (!menuLinks || menuLinks.length < 4) {
return null;
}
return document.querySelector(
'form.pagination__form.next-prev-form--desktop:first-of-type',
);
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | previousPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get nextPageButton() {
const menuLinks = document.querySelectorAll('.inline-nav-menu__link');
if (!menuLinks || menuLinks.length < 4) {
return null;
}
return document.querySelector(
'form.pagination__form.next-prev-form--desktop:last-of-type',
);
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | nextPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get tabs() {
const menuLinks = document.querySelectorAll('.inline-nav-menu__link');
if (!menuLinks || menuLinks.length < 4) {
return {};
}
return {
navigateSearchTab: menuLinks[0],
navigateImagesTab: menuLinks[1],
navigateVideosTab: menuLinks[2],
navigateNewsTab: menuLinks[... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | tabs | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
changeTools(period) {
const forms = document.forms;
let timeForm;
for (let i = 0; i < forms.length; i++) {
if (forms[i].className === 'search-filter-time__form') {
timeForm = forms[i];
}
}
switch (period) {
case 'd':
timeForm.elements['with_date'][1].click();
... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | changeTools | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
this.gridNavigation = false;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/(www)\.youtube\./;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
return 'input#search';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getTopMargin(element) {
return getFixedSearchBoxTopMargin(
document.querySelector('#masthead-container'),
element,
);
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getTopMargin | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
onChangedResults(callback) {
// The ytd-section-list-renderer element may not exist yet when this code
// runs, so we look for changes in the higher level elements until we find
// ytd-section-list-renderer.
const YT_CONTAINER_SELECTOR = [
'ytd-section-list-renderer',
'.ytd-section-list-rend... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | onChangedResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
pageObserverCallback = (mutationsList, observer) => {
const url = window.location.pathname + window.location.search;
if (url === lastLoadedURL) {
return;
} else {
resultsObserver.disconnect();
}
const containers = document.querySelectorAll(YT_CONTAINER_SELECTOR);
if (... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | pageObserverCallback | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
pageObserverCallback = (mutationsList, observer) => {
const url = window.location.pathname + window.location.search;
if (url === lastLoadedURL) {
return;
} else {
resultsObserver.disconnect();
}
const containers = document.querySelectorAll(YT_CONTAINER_SELECTOR);
if (... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | pageObserverCallback | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
const includedElements = [
// Videos in vertical search results: https://imgur.com/a/Z8KV5Oe
{
nodes: document.querySelectorAll('a#video-title.ytd-video-renderer'),
highlightClass: 'wsn-youtube-focused-video',
highlightedElementSelector: (n) => n.closest('ytd... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
changeTools(period) {
if (!document.querySelector('div#collapse-content')) {
const toggleButton = document.querySelectorAll(
'a.ytd-toggle-button-renderer',
)[0];
// Toggling the buttons ensures that div#collapse-content is loaded
toggleButton.click();
toggleButton.click();
... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | changeTools | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/scholar\.google\./;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
return '#gs_hdr_tsi';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
const includedElements = [
{
nodes: document.querySelectorAll('.gs_rt a'),
highlightClass: 'wsn-google-focused-link',
highlightedElementSelector: (n) => n.closest('.gs_rt'),
containerSelector: (n) => n.parentElement.parentElement,
},
{
n... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get previousPageButton() {
const previousPageElement = document.querySelector('.gs_ico_nav_previous');
if (previousPageElement !== null) {
return previousPageElement.parentElement;
}
return null;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | previousPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get nextPageButton() {
const nextPageElement = document.querySelector('.gs_ico_nav_next');
if (nextPageElement !== null) {
return nextPageElement.parentElement;
}
return null;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | nextPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/(www\.)?amazon\./;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
return '#twotabsearchtextbox';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
onChangedResults(callback) {
const container = document.querySelector('.s-main-slot');
if (!container) {
return;
}
const observer = new MutationObserver(
debounce((mutationsList, observer) => {
callback(false);
}, 50),
);
observer.observe(container, {
attrib... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | onChangedResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
const includedElements = [
// Carousel items
{
nodes: document.querySelectorAll(
'.s-main-slot .a-carousel-card h2 .a-link-normal.a-text-normal',
),
highlightedElementSelector: (n) => n.closest('.a-carousel-card'),
highlightClass: 'wsn-ama... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get previousPageButton() {
return document.querySelector('a.s-pagination-previous');
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | previousPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get nextPageButton() {
return document.querySelector('a.s-pagination-next');
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | nextPageButton | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
constructor(options) {
this.options = options;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | constructor | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get urlPattern() {
return /^https:\/\/(www\.)?github\.com/;
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | urlPattern | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
get searchBoxSelector() {
// TODO: With the escape key, this only works the first time the keybinding
// is used, Since Github seem to capture this as well, which causes it to
// leave the search box.
return 'input[name="q"]';
} | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | searchBoxSelector | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
getSearchResults() {
const includedElements = [
// Repos
{
nodes: document.querySelectorAll('.repo-list a'),
highlightClass: 'wsn-github-focused-item',
containerSelector: (n) => n.closest('.mt-n1'),
},
// Code
{
nodes: document.querySelectorAll('#code_se... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | getSearchResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
onChangedResults(callback) {
const container = document.querySelector('body');
if (!container) {
return;
}
// Store the last URL to detect page navigations (for example going to the
// next page of results).
let lastURL = window.location.href;
const observer = new MutationObserver(
... | Filter the results based on special properties
@param {*} period, filter identifier. Accepted filter are :
'a' : all results
'h' : last hour
'd' : last day
'w' : last week
'm' : last month
'y' : last year
'v' : verbatim search
null : toggle sort | onChangedResults | javascript | infokiller/web-search-navigator | src/search_engines.js | https://github.com/infokiller/web-search-navigator/blob/master/src/search_engines.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.