Seiry

Seiry

Experimental Web Platform features have caused a mysterious cross-origin bug called "PreflightMissingAllowPrivateNetwork".

Cause

I have been using Obsidian for quite some time now. Today, while browsing Twitter, someone recommended a Chrome extension, https://chrome.google.com/webstore/detail/obsidian-web/edoacekkjanmingkbkgjndndibhkegad, which can be used with the Obsidian API plugin.

After configuring it properly, I kept encountering a strange error.

Could not connect to Obsidian! Make sure Obsidian is running and that the Obsidian Local REST API plugin is enabled.

However, in the plugin settings, it already showed a cute green shield.

So, I decided to check the page (the target page) using devtools. I discovered a strange error.

Cross-Origin Resource Sharing error: PreflightMissingAllowPrivateNetwork

Search

I tried searching directly, but I couldn't say that I found nothing. I could only say that I didn't find much.

The devtool error code was not explained in detail.

I found a blog post that seemed to be endlessly delayed.

In combination with the answers from GPT, I speculated that this is a feature in development.

Taking the blame

This reminded me of the recent issue I had with the Xiaomi temperature and humidity sensor 2. In the documentation (https://pvvx.github.io/ATC_MiThermometer/TelinkMiFlasher.html) and the repository (https://github.com/pvvx/ATC_MiThermometer), it specifically mentioned the flag #enable-experimental-web-platform-features, so I disabled it.

Problem solved.

So, this thing is not experimental, but rather delayed features.

Conclusion

The cause of this problem is actually diverse.

Firstly, over the years, Chrome has accumulated new features, controversial features, and various breaking changes, which have piled up like a mountain. Especially in the current economic environment, with increased engineer turnover, Google is finding it difficult to continue flushing the toilet. So, as many people pessimistically believe, Chrome, which is in the midst of a shitstorm, is becoming the next IE.

Secondly, the Obsidian web plugin's JavaScript instance is directly injected into the target webpage. It is neither a high-privilege script like userscripts nor a native Chrome extension with its own permissions. It has a bit of a homemade feel to it.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.