: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<div class="viewer-container" id="viewer-container"></div>
<script src="../../../../../wp-includes/js/jquery/jquery.js"></script>
<script src="js/html2canvas.min.js"></script>
<script src="js/three.min.js"></script>
<script src="js/pdf.min.js"></script>
<script src="js/3dflipbook.min.js"></script>
<script type="text/javascript">
html: "templates/book-view.html",
styles: ["css/ep-black-book-view.css"],
script: "js/default-book-view.js",
startFlip: "sounds/start-flip.mp3",
endFlip: "sounds/end-flip.mp3",
// Ensure the script runs after the page has fully loaded
// Function to extract the file URL from the query parameters
function extractFileParamData(src, $param) {
// Extract the 'file' parameter from the query string
var fileUrl = url.searchParams.get($param);
window.onload = function () {
// Access the parent window
var parentWindow = window.parent;
// Get the iframes within the parent window
var iframes = parentWindow.document.getElementsByTagName("iframe");
for (var i = 0; i < iframes.length; i++) {
if (iframes[i].contentWindow === window) {
// Get the src attribute of the iframe
parentIframeSrc = iframes[i].src;
jQuery("#viewer-container").FlipBook({
pdf: extractFileParamData(parentIframeSrc, "file"),
// The encoded string you want to decode
const encodedString = extractFileParamData(parentIframeSrc, "key");
const decodedString = atob(encodedString);
// Step 1: Create URLSearchParams object
const urlParams = new URLSearchParams(decodedString);
// Step 2: Convert URLSearchParams to Object
for (const [key, value] of urlParams.entries()) {
value == "yes" || value == "true"
const newSettings = decodedString;
let oldData = localStorage.getItem("flipbook_settings");
settingsArray = oldData ? JSON.parse(oldData) : [];
if (!Array.isArray(settingsArray)) {
settingsArray.push(newSettings);
let newData = JSON.stringify(settingsArray);
localStorage.setItem("flipbook_settings", newData);
let updatedData = localStorage.getItem("flipbook_settings");
break; // Exit the loop once the matching iframe is found and processed