Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Remove arbitrary HTML from header and footer #20

@Lewiscowles1986

Description

@Lewiscowles1986

Arbitrary HTML could be removed frontend before sending to sandbox by creating a fragment from the css and js segments and disallowing any visible content.

This would make the plugin compatible with a wider range of themes and plugins, assisting in reducing the prevalence of themes and plugins in #7

  1. Upon successful response body
  2. Create a fragment with a wrapper element we can address from (reduces false positives from nested elements)
  3. create iterable discover list querySelectorAll within the fragment using wrapper as namespace with only direct decedents on any non script, link, style, template (block visible elements)
  4. remove all these direct descendents
  5. get innerHTML of the fragment wrapper
  6. send this to sandbox

Technically this means after receiving a response, parsing and modifying that response.

The reason I think this is best done Frontend is because it has a Real DOM to work with avoiding PHP, libxml and other parsing framework issues.

Drawbacks are additional complexity and iteration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededneeds designThis is interesting, but needs design input

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions