google chrome - Replace remote JavaScript file with a local debugging copy using Greasemonkey or userscript -


while debugging client app uses google backend, have added debugging versions of functions , inserted them using chrome developer tools script editor.

however there number of limitations approach, first editor doesn't seem work de-minified files, , when js file 35k lines long, problem.

another issue initialization done during load time, uses original "unpatched" functions, hence not ideal.

i replace remote javascript.js file own local copy, presumably using regex on file name, or whatever strategy suitable, happy use either firefox or chrome, if 1 easier other.

so basically, @brockadams identified, there couple of solutions these types of problem depending on requirements, , follow either 1 of 2 methods.

  1. the browser api switcharoo.
  2. the proxy based interception befiddlement.

the browser api switcharoo. both firefox , chrome support browser extensions can take advantage of platform specific apis register event handlers "onbeforeload" or "onbeforerequest" in case of firefox , chrome respectively. chrome apis experimental, hence these tools better developed under firefox. 2 tools required adblock plus , jsdeminifier both of have source code available.

the key point these 2 firefox apps intercept web request before browser gets hands on , operate on other side of http/https encrpytion stage, hence can see decrypted response, identified in the other post don't whole thing, although jsdeminifier useful, didn't find firefox plugin wanted, can see previous plugins, it possible both firefox , chrome. though don't trick required.

the proxy based interception befiddlement better option in plain http environment, there whole bunch of proxies such pivoxy, fiddler2, charles web http proxy, , presumably didn't @ such snort support filtering of sort.

the simplest solution myself foxyproxy , privoxy on firefox, , configure user.action , user.filter detect url of page, , apply filter swapped out original src tag, own one.

the https case. proxy vs plugin when request https proxy can't see request url or response body, can't cool swapping stuff. there 1 option available mess browser. , man-in-the-middle ssl proxy. charles web http proxy appears main solution problem. way works when browser makes request remote https server, ssl proxy intercepts request , ip address of server generates server certificate on fly, signs own root ca, , sends browser. browser complains self-signed cert, here can choose install ssl proxy root ca cert browser, befuddling browser , allowing ssl proxy man in middle , make replacements , filters on raw response body.

alternative roll own chrome extension decided go rolling own chrome extension, planning make available. in hardcoded own requirements state, works pretty good, https requests , benefit browser plugin solution can more tightly integrated browser developer tools.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -