Bug 258287

Summary: Allow for string replace in script URLs
Product: WebKit Reporter: Matthieu Henocque <matthieuhenocque>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Enhancement CC: inspector-bugzilla-changes, rcaliman, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: All   
OS: All   
Attachments:
Description Flags
Request Local Override - Redirect none

Description Matthieu Henocque 2023-06-19 16:13:03 PDT
Hello there!

First things first, thank you very much to the WebKit team for your amazing work. It's an absolute pleasure to work with Safari development tools.

Now, I'm here to make a feature request, and I hope it will find its way.

I'm a frontend developer in a French ad-tech company named Viously. I mostly work on vanilla javascript for performance reasons.

Our workflow means we have to debug our scripts on our publishers websites.

Our development codebase is mainly served by pre-production servers, but the very first script that is loaded is served by a cdn, which role is to determine if the user wants to see our ads or not. This very first script has our other scripts url hardcoded

In order to load the development scripts from our development servers, we have to override the production urls. We use an extension called Requestly in Chrome and Firefox that allows string replacement in urls, but it's not safe. And without surprise, the extension is not available for Safari in the AppStore, and can only be used with an awful desktop app that take control of the whole system.

I tried to use the Local Overrides feature, but it doesn't allow to change the url of a script.

I manage to do what I need by overriding a variable directly into the source code of the first script, but it would be so much simpler if I could simply change the url directly as a Local Override.

I understand that our workflow is not ideal (it wasn't always that way) and that you could be reluctant to help me regarding my area of work, but I have a feeling this feature could be helpful to anyone.

Once again, thank you very much for your work. Best regards


Matthieu Henocque
Comment 1 Radar WebKit Bug Importer 2023-06-26 16:13:13 PDT
<rdar://problem/111354299>
Comment 2 Razvan Caliman 2023-08-18 10:20:39 PDT
Created attachment 467327 [details]
Request Local Override - Redirect

Hello Matthieu, 

It's possible to add a Request Local Override for a file and use the Redirect input field to point at a different URL. See attached screenshot. 

Does this not do what you need?