diff --git a/changelog.txt b/changelog.txt
index fd6302b..14ee738 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -5,6 +5,7 @@ Updates (install signed xpi-file): https://gitlab.com/magnolia1234/bypass-paywal
Post-release
Add Groupe ESH Medias (ch)
Fix Beobachter.ch & Handelszeitung.ch
+Fix Foreign Policy (Insider)
* v3.2.2.0 (2023-06-25)
Add Follow the Money (Ftm.eu)
diff --git a/contentScript.js b/contentScript.js
index 3c1ae3f..5675275 100644
--- a/contentScript.js
+++ b/contentScript.js
@@ -3554,10 +3554,31 @@ else if (matchDomain('foreignaffairs.com')) {
else if (matchDomain('foreignpolicy.com')) {
let content_ungated = document.querySelector('div.content-ungated');
- removeDOMElement(content_ungated);
- let content_gated = document.querySelector('div.content-gated');
- if (content_gated)
- content_gated.classList.remove('content-gated');
+ if (content_ungated && dompurify_loaded) {
+ removeDOMElement(content_ungated);
+ let content_gated = document.querySelector('div.content-gated');
+ if (content_gated) {
+ content_gated.classList.remove('content-gated');
+ let insider = document.querySelector('body.is-fp-insider');
+ if (insider) {
+ window.setTimeout(function () {
+ let json_script = getArticleJsonScript();
+ if (json_script) {
+ let json = JSON.parse(json_script.text);
+ if (json) {
+ let content = json.Articlebody.replace(/\r\n/g, '
');
+ if (content) {
+ let parser = new DOMParser();
+ let doc = parser.parseFromString('