While watching a Video Tutorial on a certain website, I noticed that the videos were hosted on platform.thinkific.com and displayed in a light theme. However, I prefer Dark Theme, so I decided to invert the color of the video using the filter: invert(90%)
property. Manually applying this property each time was quite cumbersome, leading me to write a script for automation. Unfortunately, I encountered an issue with the script:
Permission denied to access property "document" on cross-origin object
I understand that this error is a result of browser security measures. Since I am running this script within my own browser, I believe there should be a way to disable this feature. My goal is to create a bookmarklet to automate this task, so my question is how can I achieve this? Is there a method to make it function or streamline this workflow?
The script I created looks like this:
var iframedoc = document.getElementById("iframe-ember5848");
var innerdoc = iframedoc.contentDocument || iframedoc.contentWindow.document;
var video=innerdoc.querySelector("#wistia_video video");
video.style.filter=="invert(90%)"?video.style.filter="":video.style.filter="invert(90%)";
My current setup involves using Firefox on Ubuntu 22.04 LTS.