Repository Drag&Drop not working in Chrome for object tag

Repository Drag&Drop not working in Chrome for object tag

by Tim V. -
Number of replies: 0

I've created my own repository and using the "get_listing" function to return the "object" tag:

    $url = new moodle_url('/repository/demo/view.php');

    return [
      'nosearch' => true,
      'nologin' => true,
      'manage' => false,
      'object' => [
         'type' => 'text/html',
         'src' => $url->out()
      ]
    ];

Everything works fine... my repository shown in the repository list, you can select files and so on. But the problem is that my repository is using Drag&Drop for file upload. So you can simple move files from your local PC to my repository. In FireFox 77 and IE11 is works perfectly but in Chrome 83 it doesn't work.

After some investigation I figured out that the problem is the "object"-tag itself. Moodle is using the "object" tag to embedd external web pages:

<object data="https://mymoodle.tld/repository/demo/view.php" type="text/html" id="container_object" class="fp-object-container"></object>

When I replace the "object"-tag by an iframe, it also works in Chrome:

<iframe src="https://mymoodle.tld/repository/demo/view.php" id="container_object" class="fp-object-container"></object>

Did anyone faced a similar issue? Is there any chance to solve this issue?
I never expected that Chrome is the problem.

Unfortunately, the Drag&Drop feature is essential for my repository plugin.

Average of ratings: -