First of all from the Drupal page only the HTML body is used as content for the Grails page. In addition to that some meta tags are extracted:
Search the whole Drupal page for "link" tags. If the found tag has the attribute "rel=stylesheet" and it is not an absolute URL (don't has a scheme component) then put the Drupal URL in front.
If the attribute "src" doesn't start with "//" then put the Drupal URL in front.
Does the content type of the URL contain a "length" parameter then don't modify it.
If the href starts with
/item/
/entity/
/organization/
/about-us/
/searchresults
/advancedsearch
/login
/user/
/journal/daily/
/journal/persons/
then do nothing
If the attribute "src" is not an absolute URL (don't have a scheme component) then put the Drupal URL in front.
The action attribute will be handled as a href in the a tags.
Only the specific form selected by id it will be specially handled it. TODO: find a better way to select them if exists.