You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Stardown has only one message it can easily send from background.js to content.js to initiate copying markdown. Making the relevant code more general will enable future development towards different copying behavior depending on what the user is interacting with.
Specifically, the sendCopyMessage function in background.js (in both the Firefox and Chromium folders) should accept a string input that replaces the string literal "getClickedElementId" so that the browser.runtime.onMessage.addListener calls in the content.js files can receive different messages.
Later, we will be able to more easily get info about what the user is interacting with (which could be selected content, an image, a video, etc.) by changing contexts: ['all'], in browser.contextMenus.create in background.js to a more specific context type. This way, Stardown will be able to copy the markdown equivalent of a wide variety of website contents while having only one context menu option that automatically changes depending on what the user is interacting with.
Currently, Stardown has only one message it can easily send from background.js to content.js to initiate copying markdown. Making the relevant code more general will enable future development towards different copying behavior depending on what the user is interacting with.
Specifically, the
sendCopyMessage
function in background.js (in both the Firefox and Chromium folders) should accept a string input that replaces the string literal"getClickedElementId"
so that thebrowser.runtime.onMessage.addListener
calls in the content.js files can receive different messages.Later, we will be able to more easily get info about what the user is interacting with (which could be selected content, an image, a video, etc.) by changing
contexts: ['all'],
inbrowser.contextMenus.create
in background.js to a more specific context type. This way, Stardown will be able to copy the markdown equivalent of a wide variety of website contents while having only one context menu option that automatically changes depending on what the user is interacting with.Context type docs:
The text was updated successfully, but these errors were encountered: