sindresorhus/refined-github

`set-default-repositories-type-to-sources`: undefined is not an object (evaluating 'link.search') #3908

fregante posted onGitHub

<img width="421" alt="Screen Shot 1" src="https://user-images.githubusercontent.com/1402241/105560421-4b8b2180-5cd9-11eb-887f-87ce95f81912.png">

  1. Open a PR like https://github.com/sindresorhus/refined-github/pull/3904
  2. Visit the PR Commits tab
  3. Open the profile dropdown

    <img width="201" alt="Screen Shot 3" src="https://user-images.githubusercontent.com/1402241/105560491-79706600-5cd9-11eb-8591-2fb8229a6e10.png">

This happens because:

  1. init is called on every ajax load
  2. init attaches a mutation handler
  3. when the user opens the dropdown, the handler fires twice, but the second time the selector no longer finds anything

Fund this Issue

$0.00
Funded

Pull requests