PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 4.3.1
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v4.3.1
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / assets / js / remove-round-button.js
embedpress / assets / js Last commit date
vendor 7 years ago admin.js 1 year ago ads.js 1 year ago carousel.js 1 year ago carousel.min.js 2 years ago documents-viewer-script.js 3 years ago embed-ui.min.js 11 months ago front.js 1 year ago gallery-justify.js 1 year ago glider.js 1 year ago glider.min.js 2 years ago gutneberg-script.js 1 year ago index.html 7 years ago initCarousel.js 2 years ago initplyr.js 2 years ago instafeed.js 2 years ago license.js 2 years ago pdfobject.js 1 year ago plyr.js 1 year ago plyr.polyfilled.js 3 years ago preview.js 10 months ago remove-round-button.js 11 months ago settings.js 6 years ago vimeo-player.js 2 years ago ytiframeapi.js 2 years ago
remove-round-button.js
143 lines
1 /**
2 * Alternative approach to remove jx-svg-round-button
3 * This script intercepts iframe creation and modifies the content
4 */
5
6 (function() {
7 'use strict';
8
9 // Store original createElement method
10 const originalCreateElement = document.createElement;
11
12 // Override createElement to intercept iframe creation
13 document.createElement = function(tagName) {
14 const element = originalCreateElement.call(this, tagName);
15
16 if (tagName.toLowerCase() === 'iframe') {
17 // Add load event listener to remove round buttons
18 element.addEventListener('load', function() {
19 setTimeout(() => {
20 try {
21 const iframeDoc = element.contentDocument || element.contentWindow.document;
22 if (iframeDoc) {
23 // Remove existing round buttons
24 const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title');
25 roundButtons.forEach(button => {
26 button.style.display = 'none';
27 button.remove();
28 });
29
30 // Add CSS to prevent future round buttons
31 const style = iframeDoc.createElement('style');
32 style.textContent = '.jx-svg-round-button, .jx-carousel-title { display: none !important; }';
33 iframeDoc.head.appendChild(style);
34
35 // Watch for dynamically added round buttons
36 const observer = new MutationObserver(function(mutations) {
37 mutations.forEach(function(mutation) {
38 mutation.addedNodes.forEach(function(node) {
39 if (node.nodeType === 1) {
40 if (node.classList && node.classList.contains('jx-svg-round-button')) {
41 node.remove();
42 } else if (node.querySelectorAll) {
43 const newRoundButtons = node.querySelectorAll('.jx-svg-round-button, .jx-carousel-title');
44 newRoundButtons.forEach(button => button.remove());
45 }
46 }
47 });
48 });
49 });
50
51 observer.observe(iframeDoc.body, {
52 childList: true,
53 subtree: true
54 });
55 }
56 } catch (e) {
57 // Cross-origin iframe, try alternative approach
58 console.log('Cross-origin iframe detected, using alternative method');
59
60 // Try to modify the iframe src to include custom CSS
61 const src = element.getAttribute('src');
62 if (src && !src.includes('hide-round-button')) {
63 // This would need to be implemented based on the specific iframe source
64 console.log('Would need to modify iframe source:', src);
65 }
66 }
67 }, 100);
68 });
69 }
70
71 return element;
72 };
73
74 // Also handle existing iframes
75 function processExistingIframes() {
76 const iframes = document.querySelectorAll('iframe');
77 iframes.forEach(iframe => {
78 if (!iframe.dataset.processedForRoundButton) {
79 iframe.dataset.processedForRoundButton = 'true';
80
81 if (iframe.contentDocument) {
82 // Same-origin iframe
83 try {
84 const iframeDoc = iframe.contentDocument;
85 const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title');
86 roundButtons.forEach(button => button.remove());
87
88 const style = iframeDoc.createElement('style');
89 style.textContent = '.jx-svg-round-button, .jx-carousel-title { display: none !important; }';
90 iframeDoc.head.appendChild(style);
91 } catch (e) {
92 console.log('Cannot access iframe content');
93 }
94 } else {
95 // Cross-origin iframe, add load listener
96 iframe.addEventListener('load', function() {
97 try {
98 const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
99 if (iframeDoc) {
100 const roundButtons = iframeDoc.querySelectorAll('.jx-svg-round-button, .jx-carousel-title');
101 roundButtons.forEach(button => button.remove());
102 }
103 } catch (e) {
104 console.log('Cross-origin iframe, cannot access content');
105 }
106 });
107 }
108 }
109 });
110 }
111
112 // Process existing iframes when DOM is ready
113 if (document.readyState === 'loading') {
114 document.addEventListener('DOMContentLoaded', processExistingIframes);
115 } else {
116 processExistingIframes();
117 }
118
119 // Watch for new iframes
120 const observer = new MutationObserver(function(mutations) {
121 mutations.forEach(function(mutation) {
122 mutation.addedNodes.forEach(function(node) {
123 if (node.nodeType === 1) {
124 if (node.tagName === 'IFRAME') {
125 processExistingIframes();
126 } else if (node.querySelectorAll) {
127 const newIframes = node.querySelectorAll('iframe');
128 if (newIframes.length > 0) {
129 processExistingIframes();
130 }
131 }
132 }
133 });
134 });
135 });
136
137 observer.observe(document.body, {
138 childList: true,
139 subtree: true
140 });
141
142 })();
143