Skip to content

[Bug] #55

Open
Open

Description

@ebola5114

Describe the bug

Bookmarklet do not work (chronium, March 22th 2026), so I fixed it with Claude after 3 tries.

javascript:%28function%28%29%7B%20if%28window.__siftlyActive%29%7Balert%28%27Siftly%20already%20running%21%27%29%3Breturn%3B%7D%20window.__siftlyActive%3Dtrue%3B%20var%20isLikes%3Dlocation.pathname.indexOf%28%27%2Flikes%27%29%3E-1%3B%20var%20source%3DisLikes%3F%27like%27%3A%27bookmark%27%3B%20var%20label%3DisLikes%3F%27likes%27%3A%27bookmarks%27%3B%20var%20all%3D%5B%5D%2Cseen%3Dnew%20Set%28%29%3B%20function%20showToast%28msg%2Cbg%29%7B%20var%20t%3Ddocument.createElement%28%27div%27%29%3B%20t.textContent%3Dmsg%3B%20t.style.cssText%3D%27position%3Afixed%3Bbottom%3A24px%3Bleft%3A50%25%3Btransform%3AtranslateX%28-50%25%29%3Bz-index%3A2147483647%3Bpadding%3A10px%2018px%3Bbackground%3A%27%2B%28bg%7C%7C%27%231e1b4b%27%29%2B%27%3Bcolor%3A%23fff%3Bborder%3A1px%20solid%20rgba%28255%2C255%2C255%2C0.15%29%3Bborder-radius%3A8px%3Bfont-size%3A13px%3Bfont-weight%3A600%3Bfont-family%3Asystem-ui%2Csans-serif%3Bbox-shadow%3A0%204px%2020px%20rgba%280%2C0%2C0%2C0.6%29%3Bwhite-space%3Anowrap%3Btransition%3Aopacity%200.3s%27%3B%20document.body.appendChild%28t%29%3B%20setTimeout%28function%28%29%7Bt.style.opacity%3D%270%27%3BsetTimeout%28function%28%29%7Bt.remove%28%29%3B%7D%2C300%29%3B%7D%2C4000%29%3B%20%7D%20var%20btn%3Ddocument.createElement%28%27button%27%29%3B%20btn.style.cssText%3D%27position%3Afixed%3Btop%3A12px%3Bright%3A12px%3Bz-index%3A2147483647%3Bpadding%3A10px%2018px%3Bbackground%3A%234f46e5%3Bcolor%3A%23fff%3Bborder%3Anone%3Bborder-radius%3A8px%3Bcursor%3Apointer%3Bfont-size%3A14px%3Bfont-weight%3A700%3Bfont-family%3Asystem-ui%2Csans-serif%3Bbox-shadow%3A0%200%200%202px%20rgba%2899%2C102%2C241%2C.4%29%2C0%204px%2016px%20rgba%280%2C0%2C0%2C.4%29%27%3B%20var%20autoBtn%3Ddocument.createElement%28%27button%27%29%3B%20autoBtn.textContent%3D%27Auto-scroll%27%3B%20autoBtn.style.cssText%3D%27position%3Afixed%3Btop%3A58px%3Bright%3A12px%3Bz-index%3A2147483647%3Bpadding%3A8px%2014px%3Bbackground%3A%2318181b%3Bcolor%3A%23a1a1aa%3Bborder%3A1px%20solid%20%233f3f46%3Bborder-radius%3A8px%3Bcursor%3Apointer%3Bfont-size%3A12px%3Bfont-weight%3A600%3Bfont-family%3Asystem-ui%2Csans-serif%27%3B%20function%20updateBtn%28%29%7Bbtn.textContent%3D%27Export%20%27%2Ball.length%2B%27%20%27%2Blabel%3B%7D%20function%20getTweetId%28article%29%7B%20var%20links%3Darticle.querySelectorAll%28%27a%5Bhref%2A%3D%5Cx22%2Fstatus%2F%5Cx22%5D%27%29%3B%20for%28var%20i%3D0%3Bi%3Clinks.length%3Bi%2B%2B%29%7B%20var%20m%3Dlinks%5Bi%5D.href.match%28%2F%5C%2Fstatus%5C%2F%28%5Cd%2B%29%2F%29%3B%20if%28m%29return%20m%5B1%5D%3B%20%7D%20return%20null%3B%20%7D%20function%20extractTweet%28article%29%7B%20var%20id%3DgetTweetId%28article%29%3B%20if%28%21id%7C%7Cseen.has%28id%29%29return%3B%20var%20authorEl%3Darticle.querySelector%28%27%5Bdata-testid%3D%5Cx22User-Name%5Cx22%5D%27%29%3B%20var%20author%3D%27Unknown%27%2Chandle%3D%27%40unknown%27%3B%20if%28authorEl%29%7B%20var%20spans%3DauthorEl.querySelectorAll%28%27span%27%29%3B%20for%28var%20i%3D0%3Bi%3Cspans.length%3Bi%2B%2B%29%7B%20var%20tx%3Dspans%5Bi%5D.textContent.trim%28%29%3B%20if%28tx%26%26tx.indexOf%28%27%40%27%29%21%3D%3D0%26%26spans%5Bi%5D.children.length%3D%3D%3D0%29%7Bauthor%3Dtx%3Bbreak%3B%7D%20%7D%20for%28var%20i%3D0%3Bi%3Cspans.length%3Bi%2B%2B%29%7B%20var%20tx%3Dspans%5Bi%5D.textContent.trim%28%29%3B%20if%28tx.indexOf%28%27%40%27%29%3D%3D%3D0%29%7Bhandle%3Dtx%3Bbreak%3B%7D%20%7D%20%7D%20var%20avatarEl%3Darticle.querySelector%28%27img%5Bsrc%2A%3D%5Cx22profile_images%5Cx22%5D%27%29%3B%20var%20avatar%3DavatarEl%3FavatarEl.src%3A%27%27%3B%20var%20textEl%3Darticle.querySelector%28%27%5Bdata-testid%3D%5Cx22tweetText%5Cx22%5D%27%29%3B%20var%20text%3DtextEl%3F%28textEl.innerText%7C%7CtextEl.textContent%29%3A%27%27%3B%20var%20timeEl%3Darticle.querySelector%28%27time%27%29%3B%20var%20timestamp%3DtimeEl%3FtimeEl.getAttribute%28%27datetime%27%29%3A%27%27%3B%20var%20media%3D%5B%5D%3B%20article.querySelectorAll%28%27%5Bdata-testid%3D%5Cx22tweetPhoto%5Cx22%5D%20img%27%29.forEach%28function%28img%29%7B%20var%20url%3Dimg.src.replace%28%2F%26name%3D%5Cw%2B%24%2F%2C%27%26name%3Dlarge%27%29%3B%20if%28url%29media.push%28%7Btype%3A%27photo%27%2Curl%3Aurl%7D%29%3B%20%7D%29%3B%20article.querySelectorAll%28%27video%27%29.forEach%28function%28vid%29%7B%20var%20url%3Dvid.src%7C%7Cvid.poster%3B%20if%28url%29media.push%28%7Btype%3A%27video%27%2Curl%3Aurl%7D%29%3B%20%7D%29%3B%20var%20hashtags%3D%5B%5D%3B%20%28text.match%28%2F%23%28%5Cw%2B%29%2Fg%29%7C%7C%5B%5D%29.forEach%28function%28h%29%7Bhashtags.push%28h.slice%281%29%29%3B%7D%29%3B%20var%20urls%3D%5B%5D%3B%20article.querySelectorAll%28%27a%5Bhref%5D%27%29.forEach%28function%28a%29%7B%20var%20exp%3Da.getAttribute%28%27data-expanded-url%27%29%7C%7C%27%27%3B%20if%28exp%26%26exp.indexOf%28%27twitter.com%27%29%3C0%26%26exp.indexOf%28%27x.com%27%29%3C0%26%26urls.indexOf%28exp%29%3C0%29urls.push%28exp%29%3B%20%7D%29%3B%20seen.add%28id%29%3B%20all.push%28%7Bid%3Aid%2Cauthor%3Aauthor%2Chandle%3Ahandle%2Cavatar%3Aavatar%2Ctimestamp%3Atimestamp%2Ctext%3Atext%2Cmedia%3Amedia%2Chashtags%3Ahashtags%2Curls%3Aurls%7D%29%3B%20updateBtn%28%29%3B%20%7D%20function%20scanAll%28%29%7B%20document.querySelectorAll%28%27article%5Bdata-testid%3D%5Cx22tweet%5Cx22%5D%27%29.forEach%28extractTweet%29%3B%20%7D%20var%20observer%3Dnew%20MutationObserver%28function%28mutations%29%7B%20for%28var%20i%3D0%3Bi%3Cmutations.length%3Bi%2B%2B%29%7B%20var%20nodes%3Dmutations%5Bi%5D.addedNodes%3B%20for%28var%20j%3D0%3Bj%3Cnodes.length%3Bj%2B%2B%29%7B%20var%20node%3Dnodes%5Bj%5D%3B%20if%28node.nodeType%21%3D%3D1%29continue%3B%20if%28node.matches%28%27article%5Bdata-testid%3D%5Cx22tweet%5Cx22%5D%27%29%29%7BextractTweet%28node%29%3B%7D%20else%7Bnode.querySelectorAll%28%27article%5Bdata-testid%3D%5Cx22tweet%5Cx22%5D%27%29.forEach%28extractTweet%29%3B%7D%20%7D%20%7D%20%7D%29%3B%20observer.observe%28document.body%2C%7BchildList%3Atrue%2Csubtree%3Atrue%7D%29%3B%20scanAll%28%29%3B%20btn.onclick%3Dfunction%28%29%7B%20if%28%21all.length%29%7BshowToast%28%27No%20%27%2Blabel%2B%27%20yet%20%E2%80%94%20scroll%20first%21%27%2C%27%2392400e%27%29%3Breturn%3B%7D%20observer.disconnect%28%29%3B%20window.__siftlyActive%3Dfalse%3B%20try%7Bdocument.body.removeChild%28btn%29%3B%7Dcatch%28e%29%7B%7D%20try%7Bdocument.body.removeChild%28autoBtn%29%3B%7Dcatch%28e%29%7B%7D%20var%20blob%3Dnew%20Blob%28%5BJSON.stringify%28%7Bbookmarks%3Aall%2Csource%3Asource%7D%2Cnull%2C2%29%5D%2C%7Btype%3A%27application%2Fjson%27%7D%29%3B%20var%20url%3DURL.createObjectURL%28blob%29%3B%20var%20a%3Ddocument.createElement%28%27a%27%29%3Ba.href%3Durl%3Ba.download%3Dsource%2B%27s.json%27%3Ba.click%28%29%3B%20setTimeout%28function%28%29%7BURL.revokeObjectURL%28url%29%3B%7D%2C1000%29%3B%20showToast%28%27Downloaded%20%27%2Ball.length%2B%27%20%27%2Blabel%2B%27%21%20Upload%20to%20Siftly.%27%2C%27%2314532d%27%29%3B%20%7D%3B%20var%20autoScrolling%3Dfalse%3B%20autoBtn.onclick%3Dfunction%28%29%7B%20if%28autoScrolling%29%7B%20autoScrolling%3Dfalse%3B%20autoBtn.textContent%3D%27Auto-scroll%27%3B%20autoBtn.style.background%3D%27%2318181b%27%3BautoBtn.style.color%3D%27%23a1a1aa%27%3BautoBtn.style.border%3D%271px%20solid%20%233f3f46%27%3B%20return%3B%20%7D%20autoScrolling%3Dtrue%3B%20autoBtn.textContent%3D%27Stop%27%3B%20autoBtn.style.background%3D%27%234f46e5%27%3BautoBtn.style.color%3D%27%23fff%27%3BautoBtn.style.border%3D%27none%27%3B%20var%20stagnant%3D0%2ClastCount%3Dall.length%3B%20function%20tick%28%29%7B%20if%28%21autoScrolling%29return%3B%20var%20col%3Ddocument.querySelector%28%27%5Bdata-testid%3D%5Cx22primaryColumn%5Cx22%5D%27%29%3B%20if%28col%29col.scrollTop%3Dcol.scrollHeight%3B%20window.scrollTo%280%2Cdocument.documentElement.scrollHeight%29%3B%20setTimeout%28function%28%29%7B%20if%28all.length%3ElastCount%29%7Bstagnant%3D0%3BlastCount%3Dall.length%3B%7D%20else%20stagnant%2B%2B%3B%20if%28stagnant%3E%3D6%29%7B%20setTimeout%28function%28%29%7B%20if%28all.length%3D%3D%3DlastCount%29%7B%20autoScrolling%3Dfalse%3B%20autoBtn.textContent%3D%27Done%20-%20%27%2Ball.length%2B%27%20captured%27%3B%20autoBtn.style.background%3D%27%2314532d%27%3BautoBtn.style.color%3D%27%2386efac%27%3BautoBtn.style.border%3D%271px%20solid%20%23166534%27%3B%20showToast%28%27Done%21%20%27%2Ball.length%2B%27%20%27%2Blabel%2B%27%20ready.%20Click%20Export.%27%2C%27%2314532d%27%29%3B%20%7D%20else%20%7Bstagnant%3D0%3Btick%28%29%3B%7D%20%7D%2C2500%29%3B%20return%3B%20%7D%20tick%28%29%3B%20%7D%2C1200%29%3B%20%7D%20tick%28%29%3B%20%7D%3B%20document.body.appendChild%28btn%29%3B%20document.body.appendChild%28autoBtn%29%3B%20updateBtn%28%29%3B%20showToast%28%27Siftly%20active%21%20Scroll%20%27%2Blabel%2B%27%20or%20use%20Auto-scroll.%27%2C%27%231e1b4b%27%29%3B%20%7D%29%28%29%3B

Activity

  1. JiwaniZakir commented on Mar 29, 2026

    @JiwaniZakir

    The breakage in Chromium around March 2026 is consistent with Chrome 134+'s tightened handling of javascript: bookmarklets, specifically stricter enforcement of Content Security Policy that can prevent inline script execution or block access to certain DOM APIs on pages with restrictive CSP headers — X/Twitter has progressively tightened its CSP. A secondary likely cause is that X updated its internal DOM structure or feed rendering logic (they frequently change class names and virtual scroll implementations), which would break any selectors or scroll-trigger logic used to collect tweet data. The fix involving multiple Claude iterations suggests it was probably a combination of both: a scroll/observation API change in the bookmarklet's collection loop and a CSP workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions