Fix for Beta/Developer builds of Opera #1010
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Regex would fail if using a Beta or Developer build of Opera as it couldn't get the version from the userAgent properly. This would result in the improved buttons for things such as banning, history, notes etc not loading.
UserAgent for Opera Developer: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 OPR/116.0.0.0 (Edition developer)"
The regex seemed to think that the version would have nothing after it, when it does it fails to match returning an empty array, it then tries to access that to get the browser version number which causes a failure.
I took the Regex from the Microsoft Edge case statement and that matches it fine. No idea why it stopped the History button and such from loading but it did as other parts of the extension would load. I have tested this on Opera Stable 114.0.5282.102, Opera Beta 115.0.5322.36 and Opera Developer 116.0.5335.0 and all 3 show no new errors when loading the locally built toolbox