From 81bfc250bb202110780f7af41b96dfd180e71f39 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 15:52:40 +0300 Subject: [PATCH 1/9] review documentcloud.org --- plugins/domains/documentcloud.org.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index cce4991d4..cacee22af 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -9,8 +9,10 @@ export default { "author", "og-title", "og-image", - "og-description", - "oembed-title" + "og-description" + // Removed "oembed-title" after January 2025 API update + // DocumentCloud now includes title in oEmbed response by default + // Title can be controlled via documentcloud.title option for iframe viewer ], // plugin is required to add aspect-ratio and with this fix embeds when used inside iFrame @@ -32,11 +34,19 @@ export default { if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) { var page = options.getRequestOptions('documentcloud.page', '1'); - var title = !!options.getRequestOptions('documentcloud.title', false); + // Title is now always in oEmbed HTML (since Jan 2025 API update) + // documentcloud.title = false (default) -> show title + // documentcloud.title = true -> hide title + var hideTitle = !!options.getRequestOptions('documentcloud.title', false); try { var iframe = oembed.getIframe(); - var href = title ? iframe.replaceQuerystring({ title: 1 }) : iframe.src; + var href = !hideTitle ? iframe.replaceQuerystring({ title: 1 }) : iframe.src; + + // Remove title attribute from HTML if hiding + if (hideTitle) { + html = html.replace(/\s+title="[^"]*"/g, ''); + } if (page && page !== '1') { if (href) { @@ -55,8 +65,8 @@ export default { value: parseInt (page) }, title: { - label: 'Show title', - value: title + label: 'Hide title', + value: hideTitle } } } catch (ex) {} @@ -102,8 +112,7 @@ export default { 'author', 'canonical', 'og-title', - 'og-image', - 'oembed-title' + 'og-image' ]}, 'https://www.documentcloud.org/documents/73991-day-three-documents', 'https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8.html#document/p2/a486265', From 753d50b381b5e49862e604f6bd2233eefc68cd63 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 16:05:03 +0300 Subject: [PATCH 2/9] try to hide title --- plugins/domains/documentcloud.org.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index cacee22af..30da34e0b 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -41,12 +41,8 @@ export default { try { var iframe = oembed.getIframe(); - var href = !hideTitle ? iframe.replaceQuerystring({ title: 1 }) : iframe.src; - - // Remove title attribute from HTML if hiding - if (hideTitle) { - html = html.replace(/\s+title="[^"]*"/g, ''); - } + // title=1 shows title (default since Jan 2025), title=0 hides it explicitly + var href = iframe.replaceQuerystring({ title: hideTitle ? 0 : 1 }); if (page && page !== '1') { if (href) { From 4f9ea66fd928d33a1a89afef6847792a26224a09 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 16:16:52 +0300 Subject: [PATCH 3/9] fix comments and qoutes --- plugins/domains/documentcloud.org.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 30da34e0b..d87eb61ad 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -2,6 +2,9 @@ export default { re: /^https?:\/\/(?:www|embed)?\.?documentcloud\.org\/documents?\/\d+/i, + // Removed "oembed-title" mixin after January 2025 API update + // DocumentCloud now includes title in oEmbed response by default + // Title is controlled via documentcloud.title option for iframe viewer (false=show, true=hide) mixins: [ "domain-icon", "oembed-site", @@ -10,9 +13,6 @@ export default { "og-title", "og-image", "og-description" - // Removed "oembed-title" after January 2025 API update - // DocumentCloud now includes title in oEmbed response by default - // Title can be controlled via documentcloud.title option for iframe viewer ], // plugin is required to add aspect-ratio and with this fix embeds when used inside iFrame @@ -34,14 +34,12 @@ export default { if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) { var page = options.getRequestOptions('documentcloud.page', '1'); - // Title is now always in oEmbed HTML (since Jan 2025 API update) - // documentcloud.title = false (default) -> show title - // documentcloud.title = true -> hide title + // documentcloud.title: false (default) = show title, true = hide title var hideTitle = !!options.getRequestOptions('documentcloud.title', false); try { var iframe = oembed.getIframe(); - // title=1 shows title (default since Jan 2025), title=0 hides it explicitly + // Embed expects title=1 to show, title=0 to hide (default is 1) var href = iframe.replaceQuerystring({ title: hideTitle ? 0 : 1 }); if (page && page !== '1') { @@ -110,14 +108,14 @@ export default { 'og-title', 'og-image' ]}, - 'https://www.documentcloud.org/documents/73991-day-three-documents', - 'https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8.html#document/p2/a486265', - // 'https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8/annotations/486265.html', - // 'https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8/pages/2.html', - 'https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal.html', - 'https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal', - 'https://embed.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal/?embed=1', - // 'https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal/pages/2.html', + "https://www.documentcloud.org/documents/73991-day-three-documents", + "https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8.html#document/p2/a486265", + "https://embed.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8", + "https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8/pages/2.html", + "https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal.html", + "https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal", + "https://embed.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal/?embed=1", + "https://www.documentcloud.org/documents/7203159-Joaqu%C3%ADn-El-Chapo-Guzm%C3%A1n-Appeal/pages/2.html", "https://www.documentcloud.org/documents/20059068-the-mueller-report#document/p17/a2001254", "https://www.documentcloud.org/documents/20059068-the-mueller-report", { From 3f0d61afb669e15fb4988949f1bd74ceb9ca90c2 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 17:14:10 +0300 Subject: [PATCH 4/9] add oembed-title back --- plugins/domains/documentcloud.org.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index d87eb61ad..2e5277243 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -2,9 +2,6 @@ export default { re: /^https?:\/\/(?:www|embed)?\.?documentcloud\.org\/documents?\/\d+/i, - // Removed "oembed-title" mixin after January 2025 API update - // DocumentCloud now includes title in oEmbed response by default - // Title is controlled via documentcloud.title option for iframe viewer (false=show, true=hide) mixins: [ "domain-icon", "oembed-site", @@ -12,7 +9,8 @@ export default { "author", "og-title", "og-image", - "og-description" + "og-description", + "oembed-title" ], // plugin is required to add aspect-ratio and with this fix embeds when used inside iFrame From 96cae07ff0b981ca2c7cc417e97f8e32dfa3fdb8 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 17:17:02 +0300 Subject: [PATCH 5/9] add oembed-title to skipMixins --- plugins/domains/documentcloud.org.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 2e5277243..8c12b3fb1 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -104,7 +104,8 @@ export default { 'author', 'canonical', 'og-title', - 'og-image' + 'og-image', + 'oembed-title' ]}, "https://www.documentcloud.org/documents/73991-day-three-documents", "https://www.documentcloud.org/documents/5766398-ASRS-Reports-for-737-max8.html#document/p2/a486265", From 41fa9992640fdc0c043e62859134dac31c3a5a74 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 17:18:10 +0300 Subject: [PATCH 6/9] remove !! --- plugins/domains/documentcloud.org.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 8c12b3fb1..563e75763 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -33,7 +33,7 @@ export default { if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) { var page = options.getRequestOptions('documentcloud.page', '1'); // documentcloud.title: false (default) = show title, true = hide title - var hideTitle = !!options.getRequestOptions('documentcloud.title', false); + var hideTitle = options.getRequestOptions('documentcloud.title', false); try { var iframe = oembed.getIframe(); From c01b1c456175fb611f5d21f5a0b9fb4da2757ee1 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 17:23:36 +0300 Subject: [PATCH 7/9] replace parameter by default --- plugins/domains/documentcloud.org.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 563e75763..efb993f04 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -38,7 +38,7 @@ export default { try { var iframe = oembed.getIframe(); // Embed expects title=1 to show, title=0 to hide (default is 1) - var href = iframe.replaceQuerystring({ title: hideTitle ? 0 : 1 }); + var href = iframe.replaceQuerystring({ title: hideTitle ? 1 : 0 }); if (page && page !== '1') { if (href) { From f218e61e6a71adabdd389a107781ef823d43b457 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 17:38:01 +0300 Subject: [PATCH 8/9] fix title --- plugins/domains/documentcloud.org.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index efb993f04..9d98d8ee5 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -38,7 +38,7 @@ export default { try { var iframe = oembed.getIframe(); // Embed expects title=1 to show, title=0 to hide (default is 1) - var href = iframe.replaceQuerystring({ title: hideTitle ? 1 : 0 }); + var href = hideTitle ? iframe.replaceQuerystring({ title: 0}) : iframe.src; if (page && page !== '1') { if (href) { From c08f31e45b44701b2ff4cff9c947b1e368fc7222 Mon Sep 17 00:00:00 2001 From: Alexey Date: Mon, 6 Apr 2026 18:15:52 +0300 Subject: [PATCH 9/9] try another fix --- plugins/domains/documentcloud.org.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/domains/documentcloud.org.js b/plugins/domains/documentcloud.org.js index 9d98d8ee5..8e60a05cc 100644 --- a/plugins/domains/documentcloud.org.js +++ b/plugins/domains/documentcloud.org.js @@ -32,13 +32,11 @@ export default { if (!/DC\-note/.test(html) && !/DC\-embed(?:\-page)?/.test(html)) { var page = options.getRequestOptions('documentcloud.page', '1'); - // documentcloud.title: false (default) = show title, true = hide title - var hideTitle = options.getRequestOptions('documentcloud.title', false); + var showTitle = options.getRequestOptions('documentcloud.title', true); try { var iframe = oembed.getIframe(); - // Embed expects title=1 to show, title=0 to hide (default is 1) - var href = hideTitle ? iframe.replaceQuerystring({ title: 0}) : iframe.src; + var href = !showTitle ? iframe.replaceQuerystring({ title: 0 }) : iframe.src; if (page && page !== '1') { if (href) { @@ -57,8 +55,8 @@ export default { value: parseInt (page) }, title: { - label: 'Hide title', - value: hideTitle + label: 'Show title', + value: showTitle } } } catch (ex) {}