-
-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
web: Implement URL rewrite rules #18252
base: master
Are you sure you want to change the base?
Conversation
f96f416
to
4389bd1
Compare
Love to see it! Just one thing - can we say more explicitly whether this rewrites URLs in urlrequests, when navigating to a URL, or both? (I assume both, since that would be the most useful.) |
Yes, it will rewrite URLs in both network requests and links. Added that to the doc. I originally needed URL rewrite for links only, but I figured that there must be content that needs to have all URLs rewritten in order to work. |
cl.click(); | ||
} | ||
}, | ||
await player.shadow$$(".modal:not(.hidden)"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebdriverIO v9 automatically pierces the shadow DOM, so hopefully this .shadow$$
is not needed anymore: https://webdriver.io/docs/api/element/shadow$/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good now!
These rules are configurable and they allow rewriting URLs used in SWFs. The main rationale behind them is to rewrite obsolete links to working ones in order to preserve old content. In order to add a rewrite rule, add a `urlRewriteRules` config option which is an array of rewrite rules. Each rule consists of a matcher (either a string or a regex), and a replacement, e.g.: window.RufflePlayer.config = { "urlRewriteRules": [ // Rewrites to a relative URL [/^https?:\/\/example.com\/(.*)\.swf$/, "$1.swf"], // Rewrites to an absolute URL [/^(.*)\.test\.swf$/, "$1.swf"], // Rewrites using a string (exact match, not a regex) ["http://old.example.com/site.html", "http://new.example.com/other_site.html"], ], };
Useful on Chromium-based browsers, where the modal is always displayed at the beginning.
These rules are configurable and they allow rewriting URLs used in SWFs. The main rationale behind them is to rewrite obsolete links to working ones in order to preserve old content.
In order to add a rewrite rule, add a
urlRewriteRules
config option which is an array of rewrite rules. Each rule consists of a matcher (either a string or a regex), and a replacement, e.g.:Related to #1486.