# post-carousel/4.0.2/src/blocks/explore-blocks.js

Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog &amp; News, version 4.0.2. 26 lines.

- Page: https://pluginprobe.com/plugins/post-carousel/4.0.2/code/src/blocks/explore-blocks.js
- Raw: https://pluginprobe.com/plugins/post-carousel/4.0.2/raw/src/blocks/explore-blocks.js
- Modified: 2026-04-24T11:48:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/post-carousel/4.0.2/code/src/blocks/explore-blocks.js#L10-L20`.

```javascript
window.addEventListener("load", function () {
    const url = new URL(window.location.href);

    if (!url.searchParams.has("spblock_inserter")) return;

    function tryClick() {
        const btn = document.querySelector(".editor-document-tools__inserter-toggle");
        if (btn) {
            btn.click();
            url.searchParams.delete("spblock_inserter");
            history.replaceState(null, "", url.toString());
            return true;
        }
        return false;
    }

    // Try every 100ms for up to 2 seconds
    let attempts = 0;
    const interval = setInterval(() => {
        attempts++;
        if (tryClick() || attempts > 20) {
            clearInterval(interval);
        }
    }, 100);
});

```
