Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So basically, as @BrockAdams identified, there are a couple of solutions to these types of problem depending on the requirements, and they follow either 1 of 2 methods. </p> <ol> <li>the browser API switcharoo.</li> <li>The proxy based interception befiddlement.</li> </ol> <p><strong>the browser API switcharoo.</strong> Both firefox and chrome support browser extensions that can take advantage of platform specific APIs to register event handlers for "onbeforeload" or "onBeforeRequest" in the case of firefox and chrome respectively. The chrome APIs are currently experimental, hence these tools are likely to be better developed under firefox. 2 tools that definitely do something like what is required are <a href="http://adblockplus.org/en/source" rel="nofollow noreferrer">AdBlock plus</a> and <a href="https://github.com/benmmurphy/jsdeminifier_xpi" rel="nofollow noreferrer">Jsdeminifier</a> both of which have the source code available.</p> <p>The key point for these 2 firefox apps is that they intercept the web request <em>before</em> the browser gets its hands on it and operate on the other side of the http/https encrpytion stage, hence can see the decrypted response, however as identified in <a href="https://stackoverflow.com/questions/7700728/replace-jquery-version-of-a-page-with-greasemonkey">the other post</a> that they don't do the whole thing, although the jsdeminifier was very useful, I didn't find a firefox plugin to do exactly what I wanted, but I can see from those previous plugins, that <em>it is possible with both firefox and chrome</em>. Though they don't actually do the trick as required.</p> <p><strong>The proxy based interception befiddlement</strong> This is definitely the better option in a plain HTTP environment, there are whole bunch of proxies such as pivoxy, <a href="http://www.fiddler2.com/fiddler2/" rel="nofollow noreferrer">fiddler2</a>, Charles Web HTTP proxy, and presumably some that I didn't look at specifically such as snort that support filtering of some sort.</p> <p>The simplest solution for myself was foxyproxy and privoxy on firefox, and configure a user.action and user.filter to detect the url of the page, and then to apply a filter which swapped out the original src tag, for my own one.</p> <p><strong>The https case. proxy vs plugin</strong> When the request is https the proxy can't see the request url or the response body, so it can't do the cool swapping stuff. However there is one option available for those who like to mess with their browser. And that is the man-in-the-middle SSL proxy. The <a href="http://www.charlesproxy.com/documentation/proxying/ssl-proxying/" rel="nofollow noreferrer">Charles Web HTTP proxy</a> appears to be the main solution to this problem. Basically the way it works is that when your browser makes a request to the remote HTTPS server, the ssl proxy intercepts the request and from the ip address of the server generates a server certificate on the fly, which it signs with its own root CA, and sends back to the browser. The browser obviously complains about the self-signed cert, but here you can choose to install the ssl proxy root CA cert into the browser, befuddling the browser and allowing the ssl proxy to man in the middle and make replacements and filters on the raw response body.</p> <p><strong>Alternative roll your own chrome extension</strong> I decided to go with rolling my own chrome extension, which I am planning to make available. Currently its in a very hardcoded to my own requirements state, but it works pretty good, even for https requests and another benefit is that a browser plugin solution can be more tightly integrated with the browser developer tools.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload