Skip to content

Commit

Permalink
Merge pull request #16 from pypp/fix-query-name
Browse files Browse the repository at this point in the history
fixed getting undefined for film's title
  • Loading branch information
pypp authored Jun 20, 2024
2 parents 15c4dab + 32ac937 commit 7175655
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extension/src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const getImdbID = () => {
};

const getQuery = () => {
const header = document.getElementById("featured-film-header");
const title = header?.querySelector("h1")?.innerText;
const year = header?.querySelector("p > small > a")?.innerText;
return `${title} ${year || ""}`;
const details = document.querySelector(".details")
const title = details?.querySelector("h1")?.innerText;
const year = details?.querySelector(".releaseyear > a")?.innerText;
return `${title ?? ""} ${year ?? ""}`;
};

const getFilmData = () => {
Expand Down

0 comments on commit 7175655

Please sign in to comment.