Closed davidcanadas closed 2 years ago
Thanks. Will have a look at it tomorrow. Btw, I briefly tried to get the HRM to display in dark mode, but didn't succeed. Is that something that you'd have an interest in quickly looking at (if it's no bother)?
I am pretty sure this dark-theming thing is not possible easily. Even if I keep the MinimalBrowser
class, which allows me to control the loaded page via iframe
, we face two problems: 1) accessing the iframe
content is prohibited by the same-origin policy (https://en.wikipedia.org/wiki/Same-origin_policy), which impedes me to change the style of the content; and 2) we can't control if the user escapes from the HRM to other places.
I've run some tests but unfortunately without any intervention from the domain owner (e.g., to allow cross-origin resource sharing permissions as in https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) we can't do it.
There is an alternate solution that is hosting the information either in a server of us (that we can control) or as data bundled within the extension. This second option looks like the best to me, because in such case it fixes the two problems above plus we can not only have "dark mode" but instead use the exact same colors/theme the user actually uses. But, I didn't do that for two main reasons: 1) I am pretty sure it sounds crazy to you to embed the HRM into the extension; and 2) I don't know the distribution license for such information, hence I don't know if we can grab the pages and redistribute them by ourselves (we would need to modify them to adapt to VSCode theming, but that would be my problem).
Thanks anyway.
You're welcome!
Fix for issue https://github.com/BartmanAbyss/vscode-amiga-debug/issues/128.
Unfortunately, I didn't find a solution to the actual problem. Some features used in these webpages are actually unavailable in the sandboxed webview, no matter whether you explicitly enable such features for the sandboxed webview (parameter
sandbox
in theiframe
, according to the documentation; all allowances were set but it refused to work).It looks like webview support is incomplete. There are solutions out there but require of other extensions, hence I discarded those.
Resources in the Deadliners' domain are now open using the external browser of choice. First time you open the page, VSCode asks you to trust the domain, after trusting it no further acceptances are needed.
However, I've kept the Amiga Hardware Reference Manual to open embedded within VSCode (because to me it makes more sense when writing code, and it's not using fancy features at all). But, given the fact that is the only resource to open embedded, I've decided to remove the MinimalBrowser class and instead rely on the built-in VSCode extension SimpleBrowser (which comes with every VSCode installment and can't be removed).