JSFiddle - React, Tailwind, and code Playground

JavaScript

var BookmarkScreenshots = {

    test: function(){
        console.log('BookmarkScreenshots.test() ran');
    },


    fullPageScreenshot: {


        //BookmarkScreenshots.fullPageScreenshot.cache.
        cache: {
            body: document.body,
            html: document.documentElement,
            fullWidthOld: document.width,
            fullHeightOld: document.height,
            originalX: window.scrollX,
            originalY: window.scrollY,
            windowScrollX: BookmarkScreenshots.fullPageScreenshot.cache.originalX,
            fullWidth: document.body.clientWidth,
            fullHeight: Math.max(BookmarkScreenshots.fullPageScreenshot.cache.body.scrollHeight, BookmarkScreenshots.fullPageScreenshot.cache.body.offsetHeight,
            BookmarkScreenshots.fullPageScreenshot.cache.html.clientHeight, BookmarkScreenshots.fullPageScreenshot.cache.html.scrollHeight, BookmarkScreenshots.fullPageScreenshot.cache.html.offsetHeight),
            windowWidth: window.innerWidth,
            windowHeight: window.innerHeight,
            originalOverflowStyle: document.documentElement.style.overflow,
            arrangements: [],
            // pad the vertical scrolling to try to deal with
            // sticky headers, 200 is an arbitrary size
            scrollPad: 200,
            yDelta: BookmarkScreenshots.fullPageScreenshot.cache.windowHeight - (BookmarkScreenshots.fullPageScreenshot.cache.windowHeight > BookmarkScreenshots.fullPageScreenshot.cache.scrollPad ? BookmarkScreenshots.fullPageScreenshot.cache.scrollPad : 0),
            xDelta: BookmarkScreenshots.fullPageScreenshot.cache.windowWidth,
            yPos: BookmarkScreenshots.fullPageScreenshot.cache.fullHeight - BookmarkScreenshots.fullPageScreenshot.cache.yDelta + 1,
            xPos: '',
            numArrangements: '',
            cleanUpTimeout: '',
            port: chrome.runtime.connect({name: 'page capture'}),
            message: {
                msg: 'capture',
               ...