Skip to content

Commit

Permalink
fix: 'a.titlelink' -> 'span.titleline a'
Browse files Browse the repository at this point in the history
  • Loading branch information
plibither8 committed Sep 28, 2022
1 parent 0d28e76 commit 86575a1
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion get-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const scripts = [
"clean",
"build",
"version",
"release:amo",
// "release:amo",
"zip",
"dev-dashboard",
"create-git-tag",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"watch:firefox": "web-ext run --source-dir=dist",
"version": "dot-json dist/manifest.json version $VER",
"zip": "cd dist && zip -r ../releases/$VER.zip ./",
"dev-dashboard": "google-chrome https://chrome.google.com/webstore/developer/dashboard",
"dev-dashboard": "open \"https://chrome.google.com/webstore/developer/dashboard\"",
"release:amo": "cd dist && web-ext-submit --api-key=$WEB_EXT_API_KEY --api-secret=$WEB_EXT_API_SECRET",
"create-git-tag": "git tag $VER -m $VER && git push origin $VER",
"changelog": "auto-changelog -v $VER && git add CHANGELOG.md && git commit -m \"Chore: Generate CHANGELOG (${VER})\"",
Expand Down
2 changes: 1 addition & 1 deletion src/features/archive-submission.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function init(metadata) {
if (metadata.path === "/item" && metadata.item.type === "story") {
const storyLink = document.querySelector("a.titlelink").href;
const storyLink = document.querySelector("span.titleline a").href;

const separatorPipe = document.createTextNode(" | ");
const archiveButton = document.createElement("a");
Expand Down
2 changes: 1 addition & 1 deletion src/features/open-story-links-in-new-tab.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function init(metadata) {
const links = [
...document.querySelectorAll("a.titlelink"),
...document.querySelectorAll("span.titleline a"),
...(metadata.options.openCommentsInNewTab
? document.querySelectorAll("table.itemlist td.subtext > a:last-child")
: []),
Expand Down
2 changes: 1 addition & 1 deletion src/features/show-similar-submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async function init(metadata) {
}

const storyLink = document
.querySelector("a.titlelink")
.querySelector("span.titleline a")
.href.split("://")
.pop();
const results = await getSimilarSubmissions(storyLink, metadata);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/dom-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function getGroupedStories(itemlist) {

for (let i = 0; i < rows.length - 2; i += 3) {
const id = parseInt(rows[i].id, 10);
const storyUrl = rows[i].querySelector("a.titlelink").href;
const storyUrl = rows[i].querySelector("span.titleline a").href;

const scoreSpan = rows[i + 1].querySelector("span.score");
const score = scoreSpan ? parseInt(scoreSpan.innerText, 10) : undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/libs/handle-item-keydowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const comment = {
const story = {
// Open story link
open(activeItem, event) {
const story = activeItem.querySelector("a.titlelink");
const story = activeItem.querySelector("span.titleline a");
if (story) {
if (event.ctrlKey || event.metaKey) {
browser.runtime.sendMessage({
Expand Down

1 comment on commit 86575a1

@lookfirst
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plibither8 ... not sure if it is my browser or what, but HN is really slow now... extension updated to 22.9.28

it does seem like this is a poor way to do things... a shared cache would be better so that these queries aren't executing the same thing over and over again.

Please sign in to comment.