sindresorhus/refined-github

`swap-branches-on-compare` should not be run on 2 dot notation #4390

yakov116 posted onGitHub

<!-- Please also include a screenshot if the issue is visible -->

URL: https://github.com/sindresorhus/modern-normalize/compare/af8df39ff9abd290cb5ee22b7d1cc3451367f8fe..f9a9045502138c23478c2d4760dfa28e01d53e7b

TypeError: Cannot read property 'parentElement' of undefined
  at init (chrome-extension://hlepfoohegkhhmjieoechaddaejaokhf/build/refined-github.js:5848:14)
  at runFeature (chrome-extension://hlepfoohegkhhmjieoechaddaejaokhf/build/refined-github.js:1924:24)
  at setupPageLoad (chrome-extension://hlepfoohegkhhmjieoechaddaejaokhf/build/refined-github.js:1937:40)
  at chrome-extension://hlepfoohegkhhmjieoechaddaejaokhf/build/refined-github.js:1958:35

As discussion https://github.com/sindresorhus/refined-github/pull/4435, it will be fixed by editing path of isCompare.

posted by KSH-code almost 4 years ago

As discussion #4435, it will be fixed by editing path of isCompare.

Small correction

If it shouldn’t run, then the only need a function in the exclude array or a new specific 3-dot detection in github-url-detection.

I think a new detection of 2 dot would be much easier and then add an exclude.

posted by yakov116 almost 4 years ago

Yeah I suppose exclude: [() => pathname.includes('..')] should be enough, at least for the time being (until or if we ever need to use this in more features)

posted by fregante almost 4 years ago

Cool, I did not know about exclude options, I'll fix

posted by KSH-code almost 4 years ago

Fund this Issue

$0.00
Funded

Pull requests