I am trying to build a chrome extension that takes a highlighted text (the use case is going to be books), searches for that text on Amazon, and auto-populates a corresponding title, book cover, and its author on the Chrome Extension popup window.
So far, I have been successful in passing the highlighted variable from the script file to the popup.js file. The question is this: is it possible for me to request a search result page, then run the typical querySelector methods to create an array of the necessary information, all without opening the window itself?
var searchLink = 'https://www.amazon.com/s?k=' + highlightedText
fetch(searchLink){
// target a certain class/id and return an array of information
Very new to JS, so apologies if this is a foolish question. I am getting a cross-origin denial when I try this in my browser console. Is this something that requires an Amazon affiliate/developer API? Thanks in advance.