webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
742 stars 66 forks source link

knudorm.kangwon.ac.kr - Buttons are not working #98828

Open webcompat-bot opened 2 years ago

webcompat-bot commented 2 years ago

URL: http://knudorm.kangwon.ac.kr/index.knu

Browser / Version: Firefox Mobile 94.0 Operating System: Android 8.0.0 Tested Another Browser: Yes Internet Explorer

Problem type: Site is not usable Description: Buttons or links not working Steps to Reproduce: when I clicked the button, it didn't work

View the screenshot Screenshot
Browser Configuration
  • gfx.webrender.all: false
  • gfx.webrender.blob-images: true
  • gfx.webrender.enabled: false
  • image.mem.shared: true
  • buildID: 20211021185848
  • channel: beta
  • hasTouchScreen: true
  • mixed active content blocked: false
  • mixed passive content blocked: false
  • tracking content blocked: false

View console log messages

From webcompat.com with ❤️

softvision-raul-bucata commented 2 years ago

We appreciate your report. I was able to reproduce the issue. Tapping on the buttons returns no action from the page:

Screenshot_2

Tested with: Browser / Version: Firefox Nightly 98.0a1 (2015860011 -🦎98.0a1-20220127094620🦎)/Chrome Mobile Version 97.0.4692.98 Operating System: Samsung A51 (Android 11) -1080 × 2400 pixels 20:9 aspect ratio (~405 ppi density)

Notes:

  1. Reproducible regardless of the status of ETP.
  2. Reproducible on the latest build of Firefox Nightly.
  3. Works as expected using Chrome: Screenshot_3

Moving this to NeedsDiagnosis for further investigations.

[qa_04/2022]

karlcow commented 2 years ago

The site is opening a pop up window on click. We can see that easily when testing on RDM.

Capture d’écran 2022-02-03 à 14 39 05

<div class="col-xs-3 quick_menu" style="border: 2px solid #ff0000;">
  <div class="quick_menu_icon">
    <img src="/resources/knudorm/img/quick_menu4.png" onclick="selectMenu('menu_9764', 'SCRIPT', 'window.open(\'/dorm/popup/expence.knu\',\'\',\'width=550,height=750,scrollbars=yes,left=\'+(screen.availWidth/2-255)+\',top=0\')');">
  </div>
  <h3><a href="javascript:void(0);" onclick="selectMenu('menu_9764', 'SCRIPT', 'window.open(\'/dorm/popup/expence.knu\',\'\',\'width=550,height=750,scrollbars=yes,left=\'+(screen.availWidth/2-255)+\',top=0\')');" class="hhsc-nav-util-anchor">고지서출력</a></h3>
</div>

it relies on

selectMenu('menu_9764', 'SCRIPT', 'window.open(\'/dorm/popup/expence.knu\',\'\',\'width=550,height=750,scrollbars=yes,left=\'+(screen.availWidth/2-255)+\',top=0\')');

when first accessing the website on mobile. Firefox is asking if we want to prevent the site to open a pop-up window. If I choose Allow, the window is still not opening on mobile.

The function selectMenu is called with an error.

function selectMenu(menuId, actionType, actionValue, menuType, domain) {
    if (actionType==null||actionType=="") {
        return;
    }

    if( domain == null || domain == "" || domain == undefined || domain == "undefind"){
        domain = "";
    }
    if (actionType == "SCRIPT") {

        //window.location.href =  "javascript:" + actionValue+ ";";
        document.frmAction.location.href =  "javascript:" + actionValue+ ";";
    }else {
        if (menuType!=null&&menuType=='quick'&&actionValue.indexOf('http')==0) {
            window.open(actionValue);
        } else {
            window.location.href = domain + actionValue;
        }
    }

    return false;
}

The error is:

Uncaught TypeError: can't access property "location", document.frmAction is undefined
    selectMenu http://knudorm.kangwon.ac.kr/js/engine/services/cnplus.dorm.base.header.js:75

this line precisely

        document.frmAction.location.href =  "javascript:" + actionValue+ ";";

document.frmAction is undefined.

ooooh…

I didn't know this.

data:text/html,<!doctype html><html><iframe name="foo"></iframe></html>

calling

document.foo on this document.

what?

karlcow commented 2 years ago

The site could avoid to call document.frmAction.location and calls directly document.location. I'm moving this to needscontact.

Still I'm opening a bug on Bugzilla. https://bugzilla.mozilla.org/show_bug.cgi?id=1753380

webcompat-bot commented 2 years ago

Generate outreach template