Skip to content

Copy Job and Delete Job buttons non-functional in some older browsers #773

Closed

Description

@ldko

Looking further into the issue I mentioned on the OH-SOS call with the Copy Job (and Delete Job) modals not working on the Heritrix UI for me after updating from 3.14.2 to 3.17.2, the issue is that I am running a version of Firefox that does not support the newish HTML Invoker Commands API (command and commandfor) brought into the Heritrix UI in May. I am running Firefox 140.16.0 (extended support release) on RHEL 9.8, but support in Firefox does not arrive until 144. Is this something worth supporting in older browsers or more a case of people should ensure their browser is compatible? It is not a major issue, the UI modals work fine for me in my version of Chromium, and I can execute the actions manually on the backend anyway.

If wanting to make it compatible with older browsers, Google's search AI Overview suggested this fallback (I tried it in the dev tools console, and it fixed the issue for me):

if (!('command' in HTMLButtonElement.prototype)) {
  document.querySelectorAll('button[command][commandfor]').forEach((btn) => {
    btn.addEventListener('click', () => {
      const targetId = btn.getAttribute('commandfor');
      const command = btn.getAttribute('command');
      const target = document.getElementById(targetId);
      
      if (target) {
        if (command === 'show-modal' && typeof target.showModal === 'function') {
          target.showModal();
        } else if (command === 'close' && typeof target.close === 'function') {
          target.close();
        }
      }
    });
  });
}

Activity

  1. added a commit that references this issue on Oct 1, 2026
    f6a14ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions