Skip to content

Commit

Permalink
fix: #27 , selectively ignore missing copy button (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: Hiroki Osame <hiroki.osame@gmail.com>
  • Loading branch information
barelyhuman and privatenumber authored Aug 23, 2022
1 parent 68d7fec commit c499e83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tweet-camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ class TweetCamera {
const { root } = await client.DOM.getDocument();
const tweetContainerNodeId = await querySelector(client.DOM, root.nodeId, '#app > div > div > div:last-child');

// "Copy link to Tweet" button
const hideCopyLinkButtonNodeId = await querySelector(client.DOM, tweetContainerNodeId, '[role="button"]').catch(() => null);

await Promise.all([
// "Copy link to Tweet" button
hideNode(
client.DOM,
await querySelector(client.DOM, tweetContainerNodeId, '[role="button"]'),
),
(hideCopyLinkButtonNodeId && hideNode(client.DOM, hideCopyLinkButtonNodeId)),

// Info button - can't use aria-label because of i18n
hideNode(
Expand Down

0 comments on commit c499e83

Please sign in to comment.