Allow userscripts to work in subpath.#6
Open
ChilledSlim wants to merge 1 commit into7dJx1qP:masterfrom
Open
Conversation
Author
|
Sorry- this doesn't work correctly in all circumstances at this point due to the regex matching on location.href and location.origin. Will review further in the near future and try and get it all to work nicely. Shelf this for now. We need to include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Within StashUserscriptLibrary.js, /graphql is hardcoded which prevents it from working in a subpath (ie: if a reverse proxy points to https://mydomain:1234/stash/ or https://mydomain:4321/apps/stash/). This causes calls to the graphql interface to throw a 404 error.
It should use the current base path as a part of that. I have tested this both by accessing via IP address (ie: http://192.168.x.x:9999/) , in a root path (https://stashapp.mydomain.com:9999), in a subpath (https://apps.mydomain.com:9999/stash/ ).
document.querySelector("head > base").href appears to work in all cases and returns correctly. This is because stash sets
<base href="/stash/">or<base href="/">as per its configuration. Note that if that behaviour ever changes in stash, this code would need to be updated. Currently, it expands to the correct path to graphql.