Skip to content
Snippets Groups Projects

Master

Open Alaska requested to merge Alaska/decentraleyes:master into master

Glad to be here!

This is meant to be proof of concept, I won't take it further unless it's acceptable. It edits the source (before FF sets about processing the response data) and removes 'crossorigin' from the script tag. I think Thomas had said that removing the attribute doesn't work; but in this approach it does work on the test page code (which I used on localhost) shown here https://git.synz.io/snippets/3

The regex is faulty and needs adjustment! ...because it also deletes 'crossorigin' from unintended places. Pardon me, but I really dislike composing regex. It is meant to replace 'crossorigin' only when found within a script tag.

Won't work on jsFiddle because of how things are nested there. Not tested extensively in the wild. It needs also to handle large pages as demonstrated at: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/StreamFilter/ondata (the 2nd example there).

It might be possible to edit the data without filtering (and thereby be faster), as done on an MDN example.

Edited by Alaska

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Until the regex is perfected, this new code will continue to replace the x-origin word with 'noop', even in the discussion text on this page. Sorry for the confusion about that. Thomas, you might be able to perfect the search-and-replace regex in 1 minute; or else I will delve into that tomorrow, if this overall approach of sidestepping the attribute problem is acceptable to you.

  • Alaska changed the description

    changed the description

Please register or sign in to reply
Loading