Looking into the ggplot2 documentation issue. The documentation is generated using `pkgdown`, configured by `_pkgdown.yml` (which can be found in github, but not in the CRAN tarball). It would appear that both the default `pkgdown` templates and the custom tidyverse template used for ggplot2 include references to external javascript in their headers.
In principle, the easiest approach would be to package `pkgdown` and then patch the default template to reference `/usr/lib/javascript` instead of remote URLs. It would also be necessary to add some magic to `dh-r` to detect when pkgdown is used in the build and add the relevant javascript dependencies. However, we have a problem that the `_pkgdown.yml` file is not shipped in the CRAN tarball, so we have insufficient source to rebuild documentation for this package unless we start using github as the upstream. I suspect this applies to other packages also. The following list of packages include a reference to `pkgdown` somewhere (but I haven't verified whether this means they contain source-less documentation).