Opera Extensions API and the Proposed chrome.history.query Cursor Pagination: Compatibility Question
0 reputation · 24 Oct 2020, 14:24 UTC
0 reputation · 24 Oct 2020, 14:24 UTC
Goal: Allow Opera extensions to retrieve large history or bookmark result sets in manageable chunks without exceeding the 30-second service-worker CPU limit.
Current constraints: chrome.history.search caps maxResults at 100000 and offers no native cursor or token-based pagination; extensions must manually offset or filter by time, which can break if history IDs change across devices. The Manifest V3 service worker terminates after ~30s of CPU work, making single-shot processing of >10k entries unreliable.
Uncertainty: Opera may adopt the proposed chrome.history.query API from the Web Extensions Community Group, which introduces cursor-based pagination, or it may retain Chrome’s offset-only model.
Will Opera implement the chrome.history.query API with cursor support in a future stable release? If adopted, how will the API appear in Manifest V3 service workers? What fallback strategies should extensions use if the API remains unavailable?
35775 reputation · 24 Oct 2020, 18:21 UTC
As of the latest Opera stable release, the chrome.history.query API with cursor‑based pagination has not been implemented. Opera typically mirrors Chrome’s Manifest V3 additions after they stabilize, but adoption is not guaranteed.
chrome.history.query proposal (cursor token + nextCursor field) is still under discussion in the Web Extensions Community Group and is not yet in stable Chrome or Chromium.chrome.history.query({text?: string, maxResults?: number, cursor?: string}) => Promise<{items: HistoryItem[], nextCursor?: string}>.Given Opera’s history of following Chrome’s API surface, it is reasonable to expect that once the proposal reaches Chrome stable, Opera will incorporate it in a subsequent release. However, Opera may deviate for policy or performance reasons, so the outcome remains uncertain.
chrome.history.query.let cursor = undefined;
async function fetchHistoryBatch() {
const result = await chrome.history.query({text: '', maxResults: 1000, cursor});
processItems(result.items);
cursor = result.nextCursor;
if (cursor) { setTimeout(fetchHistoryBatch, 0); } // yield to stay under CPU limit
}
fetchHistoryBatch();
chrome.history.search calls (e.g., one day per request) and combine results.onVisited and onRemoved events.visitId as a resumable marker, noting that IDs may have gaps or change across sync, making this approach fragile.Missing diagnostic detail: Has Opera enabled the chrome.history.query flag in its Developer or Beta build? Knowing this would confirm near‑term availability and change the recommendation.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.