Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Truncates part of the data in JS #382

Closed
co-in opened this issue Feb 25, 2021 · 1 comment
Closed

Bug: Truncates part of the data in JS #382

co-in opened this issue Feb 25, 2021 · 1 comment

Comments

@co-in
Copy link

co-in commented Feb 25, 2021

JS for Test

object =  '<style id="MSLMobileAppInformerCSS">@font-face{font-family:"PSSansRegular";src:url(/css/fonts/PTSansRegular.ttf)}@font-face{font-family:"PSSansBold";src:url(/css/fonts/PTSansBold.ttf)}@font-face{font-family:"PSSansItalic";src:url(/css/fonts/PTSansItalic.ttf)}.bg-informer{display:block;background:rgba(0,0,0,.5);height:100%;left:0;position:fixed;top:0;width:100%;z-index:100}.get-mobile-app{display:block;height:27rem;margin:10% auto;max-height:562px;width:496px}.get-mobile-app .wrapper-informer{height:304px;padding:0;position:absolute;width:496px!important}.get-mobile-app .smartphone{z-index:1;float:left;left:-48px;position:absolute;top:-48px;width:160px}.get-mobile-app .content{background:#fbfbfc;border-radius:10px;box-shadow:0 0 7px rgba(0,0,0,.5);display:block;font-family:"PSSansBold";height:304px;text-align:left;text-transform:uppercase;width:99%;opacity:1}.get-mobile-app .content p:nth-child(1){color:#434343;font-size:24px;left:27%;position:absolute;text-align:left;text-transform:uppercase;top:48px}.get-mobile-app .content p:nth-child(2){color:#434343;font-size:33.6px;left:27%;line-height:48px;position:absolute;text-align:left;text-transform:uppercase;top:27%;width:53%}.get-mobile-app__close{background:url(/img/MSLMobileAppInformer/get_mobile_close_btn.png) no-repeat;cursor:pointer;display:block;float:right;height:20px;left:8px;position:relative;top:-21px;width:20px}.get-mobile-app .android{z-index:1;float:right;left:80%;position:absolute;top:32px;width:176px}.get-mobile-app .content .no-thanks{background:#c4c4c4;border-radius:10px;cursor:pointer;float:right;font-family:"PSSansRegular";font-size:1.3em;left:139px;line-height:44.8px;position:absolute;text-align:center;text-transform:none;top:244.8px;width:26%}.get-mobile-app .content .install-now{background:#72cf95;border-radius:10px;color:#fff;cursor:pointer;float:right;font-family:"PSSansRegular";font-size:1.6em;left:288px;line-height:54.4px;position:absolute;text-align:center;text-transform:none;top:236.8px;width:39%}@media(max-width:1500px){.get-mobile-app .content p:nth-child(2){width:52%}}@media(max-width:1756px){.get-mobile-app .content .no-thanks{font-size:1em;height:41.6px}.get-mobile-app .content .install-now{font-size:1.2em;height:49.6px}}@media (max-width: 992px) {' +
        '}@media (max-height: 380px) {' +
        '    .get-mobile-app {' +
        '        height: 192px;' +
        '    }' +
        '    .get-mobile-app .content {' +
        '        height: 240px;' +
        '    }' +
        '    .get-mobile-app .smartphone {' +
        '        width: 136px;' +
        '        left: -32px;' +
        '    }' +
        '    .get-mobile-app .android {' +
        '        width: 144px;' +
        '        top: 16px;' +
        '    }' +
        '    .get-mobile-app .content .no-thanks {' +
        '        top: 184px;' +
        '        left: 132.8px;' +
        '    }' +
        '}</style>';

window.document.body = object.a;

Output
object='}@media (max-height: 380px) { .get-mobile-app { height: 192px; } .get-mobile-app .content { height: 240px; } .get-mobile-app .smartphone { width: 136px; left: -32px; } .get-mobile-app .android { width: 144px; top: 16px; } .get-mobile-app .content .no-thanks { top: 184px; left: 132.8px; }}</style>',window.document.body=object.a

@tdewolff
Copy link
Owner

tdewolff commented Mar 1, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment