If the secondary bar component is not included, then the variable would not be declared, causing a ReferenceError to be thrown. If you truly want to separate this functionality from the the find bar, bind the event listener in secondary_toolbar.js.

Since secondaryToolbar is integrated in viewer.js, it makes sense to move the logic from the find bar to `if (evt.keyCode === 27) { ... }` at https://github.com/timvandermeij/pdf.js/blob/c9e5f9af58d4cccd0df5e3d3d547d5267feeee35/web/viewer.js#L2682.