Viewport Enter Event - only one time

I think that’s what you are referring to @CODE-NINJA - so, I’ll send you an invitation - once you confirm here…

Will the following “role” suffice?

Website Designer
Can edit the site, manage settings and apps but cannot access Inbox, contacts and other sensitive info.

I only need to be able to change code, everything of all your other stuff or data, is not interessting for me.

I see that you have already accepted my invitation…
So, how should I go about providing those :point_up_2: to you - here, or via email?

RIGHT! I need now to know where to look at.
Like expected → you have already created a lot of pages and other stuff.

It’s the only Premium site > called “B A B L I”

And the Page (on the Editor) - Wix Hotels > Book a Room (published url is https://www.babli.org/book-a-room)

Please leave your editor now → checking the issue (about 30 min), thanks.

I think i will need more time to get some results… to be continued…

By the way, some first results of investigation…

  1. This sounds → BAD !!!

  2. Like already mentioned before → Wix-Hotel does not provide any API to for communication.

  3. Entering the APP itself is also maybe not possible…
    But tried to figure out how to get access to the right iFrame/custom element on the body of the Wix-Page…

Found some informations about iFrame elements existing on your site…

The following code has been added to your DASHBOARD-CUSTOM-CODE-SETTINGS…

<script>
    console.log("Scanning-code by Russian-Dima running....");

    setTimeout(function() {
        // Initialize an array to store iframe elements
        var arrFrames = [];
        var obj = {};

        // Search for all iframes on the page
        var iframes = document.querySelectorAll("iframe");
        console.log("Found " + iframes.length + " iframe(s) on the page.");

        // Iterate through each iframe and add to arrFrames
        iframes.forEach(function(iframe) {
            // Create an object to store iframe details
            var iframeObj = {};
            iframeObj.src = iframe.src;

            // Parse the allow attribute of the current iframe
            var allowAttrs = iframe.allow.split(';');

            // Create an object to store parsed permissions
            var allowObj = {};
            allowAttrs.forEach(function(attr) {
                var trimmedAttr = attr.trim(); // Remove leading/trailing whitespace
                allowObj[trimmedAttr] = true; // Set each attribute as a key with value true
            });

            // Assign the parsed permissions object to iframeObj.iFrameAllowens
            iframeObj.iFrame = iframe;
            iframeObj.iFrameAllowens = allowObj;
            iframeObj.iFrameAllowens.allowFullscreen = iframe.allowFullscreen;
            iframeObj.iFrameAllowens.allowPaymentRequest = iframe.allowPaymentRequest;
            iframeObj.iFrameAllowens.autofocus = iframe.autofocus;
            iframeObj.iFrameAllowens.hidden = iframe.hidden;
            iframeObj.iFrameAllowens.draggable = iframe.draggable;
            iframeObj.iFrameAllowens.isContentEditable = iframe.isContentEditable;
            iframeObj.iFrameAllowens.browsingTopics = iframe.browsingTopics;
            iframeObj.ariaLabel = iframe.ariaLabel;
            iframeObj.baseURI = iframe.baseURI;
            iframeObj.className = iframe.className;
            iframeObj.isConnected = iframe.isConnected;
            iframeObj.loading = iframe.loading;
            iframeObj.localName = iframe.localName;
            iframeObj.nodeName = iframe.nodeName;
            iframeObj.nodeType = iframe.nodeType;
            iframeObj.namespaceURI = iframe.namespaceURI;





            // Push iframeObj into arrFrames array
            arrFrames.push(iframeObj);
        });

        // Search for all elements with class 'APP' on the page
        var appElements = document.querySelectorAll(".APP");
        console.log("Found " + appElements.length + " element(s) with class 'APP' on the page.");

        // Log each app element's tag name to the console
        appElements.forEach(function(element) {
            console.log("Element tag name:", element.tagName);
        });

        console.log("Element search completed.");

        // Now arrFrames contains all iframe elements found on the page
        console.log("All iframe elements:", arrFrames);

        // Store arrFrames in obj under 'iframes' key
        obj.iframes = arrFrames;

        console.log("OBJ:", obj);

    }, 3000); // Wait for 3000 milliseconds (3 seconds) before executing
</script>

First conclusion → maybe will not work to fix your problem → but will take some more time…

Thanks a tonne, mate! For all the time you are putting into this!!!

Can you help me understand that part… Where is “DASHBOARD-CUSTOM-CODE-SETTINGS”?

Open the → CUSTOM-CODE-SECTION ← inside your Wix-Dashboard.

You will see a CUSTOM-CODE, generated by me for you…


…nested inside the BODY-START-PART…

You can edit the code by your own, expanding it’S functionalities and capabilities…

By expanding the code and it’s functions, i could identify both found iFrames…

All found iFrames → gets a RED backgroundcolor, once one of them has been found.
As you can see, both found iFames have been marked red, but these 2 elements are the wrong ones.

So we still did not get what we want.

We found…

2024-07-18 01_57_29-Window
…and…
2024-07-18 01_58_14-Window

And now the → ariaLabel ← makes sense !!!

Since an updated version is now running on your site… → you also can get all the other elements on your site…

As you can see, next to the already mentioned 2-iFrames, much more elements have been found → about 348-elements, which you can now inspect by your own :blush:

Adding your own solutions and investigation-tools → will give you more possibilities to investigate, inspect, debug and develop your website.

So, that :point_up_2: ISN’T the reference for the “Search” field, which is the ‘problem’ button?

Also - where do I find this VIEW of the custom-code?

I can see the custom code on the Dashboard - but there it doesn’t really allow me to SEE the whole code?

Or maybe that :point_up_2: is a copy-paste from this? :point_down:

Wix do not like people to work on DASHBOARD-CUSTOM-CODES, this is why you have just a very very smal (tiny) window to put in your (maybe 1000-lines, or 5000-lines of code) into.

Hey @CODE-NINJA !
I think I found a workaround to solve the issue…
A simple one, really! But looks like it’s working.

Instead of trying to control the Wix Hotel App embedder in the page - I tried out a hunch, and put in an onClick function to the SECTION (#Section2) where the App has been placed in the page -


export function section2_click(event) {
            (wixWindow.scrollTo(0, 2168), { "scrollAnimation": false }); 
}

Looks like the problem IS solved.

Though it’s not a ‘smart’ looking solution - with lot’s of unnecessary jumping around! So, if you have a BETTER solution - that will be fantastic!

But for now, I think I’ll run with this one…

If it works for you, then let it run like it is.
Do also not forget to deactivate the CUSTOM-CODE, you do not need to run unneccessary codes, increasing the loding times of your website. Your website is already overloaded with a lot of logs and different stuff running in the background (installed trough different predefined stuff).

very useful thank you!
but if I change page and i go back this doesn’t work anymore. Is there a way to make tha started variable GLOBAL (valid on all pages)?
I’ll explain my problem.
i have an entrance animation on my home page but I want it to be played just the first time I visit the website

Hi, @emme_works !!

I’m not fully familiar with the context of this topic, but if you want to play an animation only when a user visits your homepage for the first time, you might be able to handle it by storing a simple log in Wix Storage. By saving a record in the user’s browser, you can determine whether they have visited your homepage before. :smiling_face_with_halo:

wow amazing tip!! thanks!!!

Wix Storage is very convenient, but be careful not to store unencrypted information carelessly. It’s best to avoid storing unencrypted personal data. However, simple visit history (e.g., true/false) should be fine.

Additionally, by saving date information, you could introduce variations in behavior based on how long ago the user last visited.

Glad I could help. Enjoy! :wink: