Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Start Mink logic onCommited instead of once the page is fully loaded

Open machawk1 opened this issue 10 years ago • 1 comments

The webNavigation API provides a hook to identify when a user had committed to a page, i.e., when loading begins and part of the initial resource has been received. This would be a better hook to start the Mink logic, since the URI is also committed and used as the basis for query to the Memento Aggregator. The current implementation waits document.ready.

machawk1 avatar Nov 05 '15 16:11 machawk1

chrome.webNavigation.onCommitted.addListener fires fine from mink.js, a background script, but the listener in content.js, a content script, never catches the message. The displayUIBasedOnContext() function reside in the content script, so message passing must be used.

machawk1 avatar Nov 05 '15 16:11 machawk1