asp.net mvc - Building a Proxy for remote sites (cross-origin js) -
I am working on an asp.net MVC application for which we need to run JavaScript bookmarklet on a remote website There is a cross-basic security restriction on our browser and the remote site can not be loaded in iframe, we can download the html of the page and load it on our page and create any type of "proxy" Of Thought Are is necessary as the work that we have been testing the code below to:
public function test (String url) {var client = new WebClient (); Var html = encoding. UTF8.GetString (client.DownloadData (url)); // Manipulate here ... Return contents (html); }
This simple part of the code works really well with one exception, all relative links (JS, CSS, images, etc ...) do not explicitly load. is. We had two questions:
- Is this the best way to manage the problem? While researching we believe that in this way we can inject javascript directly that we need to become a page and we have done it.
- What would be the best way to convert all related URLs downloaded (efficiently) into full url page? (What would be a good way to get regEx?)
Comments
Post a Comment