• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Custom button iframe no longer auto resizes to correct height.

danami

Silver Pleskian
TITLE:
Custom button iframe no longer auto resizes to correct height.
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:
Product version: Plesk Onyx 17.9.5
Build date: 2018/08/24 16:00
OS version: CentOS 7.5.1804
Revision: e9a8b33ab2aa446e48a2d368c9282458159e5f73
Architecture: 64-bit
Wrapper version: 1.2
PROBLEM DESCRIPTION:
In all previous Plesk versions when creating a custom button in Plesk with the option "Open URL in Plesk" the iframe that Plesk uses has a function that will automatically resize the iframe height to the size of the child content. In Plesk 17.9.5 the javascript function has been updated and is currently broken.

The new broken function is:

Code:
<script type="text/javascript">
//<![CDATA[
Jsw.onReady(function () {
    var resizeBlocks = function () {
        var bodyHeight = (Prototype.Browser.IE)
            ? document.documentElement.clientHeight
            : document.body.clientHeight;

        var frameHeight = bodyHeight - Element.cumulativeOffset(document.getElementById('frameWrapper'))[1]  - parseInt(document.querySelector('.page-content').style.paddingBottom);
        if (document.querySelector('.page-footer-wrapper')) {
            frameHeight -= Element.getHeight(document.querySelector('.page-footer-wrapper'));
        }

        document.getElementById('pageIframe').style.height = frameHeight + 'px';
    };

    resizeBlocks();
    window.addEventListener('resize', resizeBlocks);
});
//]]>
</script>

The previous one that worked:
Code:
<script type="text/javascript">
//<![CDATA[

Jsw.namespace('Smb.Views.CustomButtons');

Smb.Views.CustomButtons.resizeBlocks = function() {
    var bodyHeight = (Prototype.Browser.IE)
        ? document.documentElement.clientHeight
        : document.body.clientHeight;

    var frameHeight = bodyHeight - $('frameWrapper').cumulativeOffset()[1]  - parseInt($$('.page-content')[0].getStyle('paddingBottom'));
    if ($$('.page-footer-wrapper').first()) {
        frameHeight -= $$('.page-footer-wrapper').first().getHeight();
    }

    $('pageIframe').setStyle({ 'height': frameHeight + 'px' });
};

Jsw.onReady(function() {
    Smb.Views.CustomButtons.resizeBlocks();
    Event.observe(window, 'resize', Smb.Views.CustomButtons.resizeBlocks, false);
});
//]]>
</script>
STEPS TO REPRODUCE:
1. Create the file /usr/local/psa/admin/htdocs/test.html with the following code:
HTML:
<html>
1<br/>
2<br/>
3<br/>
4<br/>
5<br/>
6<br/>
7<br/>
8<br/>
9<br/>
10<br/>
11<br/>
12<br/>
13<br/>
14<br/>
15<br/>
16<br/>
17<br/>
18<br/>
19<br/>
20<br/>
21<br/>
22<br/>
23<br/>
24<br/>
25<br/>
</html>

2. Go To Tools and Settings -> Custom Buttons. Add the custom button with:
Button label: test
Location: common access
URL: /test.html
Open URL in Plesk: checked.

3. Click on the newly added button and you will see that the content is no longer resizing the height as the iframe height is always 400px regardless of the size of the html content.​
ACTUAL RESULT:
The content is no longer resizing the height as the iframe height is always 400px regardless of the size of the custom button html content.​
EXPECTED RESULT:
The custom button iframe should resize its height as all previous versions of Plesk.​
ANY ADDITIONAL INFORMATION:
This affects all of our current Plesk extensions.
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:
Confirm bug
 

Attachments

  • 2018-09-06_08h27_28.png
    2018-09-06_08h27_28.png
    35.2 KB · Views: 15
  • 2018-09-06_08h26_39.png
    2018-09-06_08h26_39.png
    97.3 KB · Views: 15
This bug has been re-introduced in Plesk 18.0.16. Our extensions are getting cut off again.

```
[root@el7p17 ~]# plesk version
Product version: Plesk Obsidian 18.0.16
Build date: 2019/06/28 21:00
OS version: CentOS 7.6.1810
Revision: 1201b634883e6defb47a675d39c89ae07fb18b68
Architecture: 64-bit
Wrapper version: 1.2
```
 

Attachments

  • 2019-07-09_09h36_22.png
    2019-07-09_09h36_22.png
    153.5 KB · Views: 8
This bug is still present in Plesk Obsidian Release Candidate 3. Now the iframe is only resized to 749px height regardless of the actual height of the content.
 
Last edited:
Hi @danami,

We can't reproduce the issue on our Plesk Obsidian RC3 builds based on provided steps. I assume there could any specific details or configuration which we are missing.

To fix the issue, it will be great if could check it on your Plesk installation. Please contact our support team Plesk Help Center with a link to this thread for further investigation.
 
Thanks for looking at this @Anthony . I was able to implement a workaround by resizing the parent iframe from within our extensions which fixes it for us.
 
Back
Top