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

improve hidedownload #31950

Closed
wants to merge 1 commit into from
Closed

improve hidedownload #31950

wants to merge 1 commit into from

Conversation

szaimen
Copy link
Contributor

@szaimen szaimen commented Apr 12, 2022

With this change getting the original previews and files gets again much more complicated. We are now pretty near the goal of only being able to get the files using the browser inspector, an external tool or a screenshot tool.

What works in my testing:

  • printing is disabled when using the shortcut and the browser option
  • saving of the site is disabled when using the shortcut; the browser option now does no longer download all assets into an separate folder and only save the html and thus link to the preview but not the preview itself
  • enable blur when the focus moves away from the tab; not sure if this makes sense at all because some screenshot tools might be able to be activated without moving the focus away from the tab. Seems to make sense indeed.

TODO:

  • discuss if we really do this
  • discuss if it should be encapsulated in a different sharing option or e.g. be enabled by a config.php switch

Signed-off-by: szaimen szaimen@e.mail.de

@szaimen szaimen added this to the Nextcloud 24 milestone Apr 12, 2022
@szaimen szaimen force-pushed the enh/noid/improve-hidedownload branch from ad80138 to d0a9dd6 Compare April 12, 2022 21:41
Comment on lines 104 to 102
// Blur elements when window has no focus
if (hideDownload === 'true') {
let sheet = document.createElement('style');
sheet.innerHTML = ".blur { filter: blur(30px); }"
document.body.appendChild(sheet);

setInterval(function () {
if (document.hasFocus()) {
document.body.classList.remove('blur');
} else {
document.body.classList.add('blur');
}
}, 300);
}
Copy link
Contributor Author

@szaimen szaimen Apr 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question is if the blur makes sense at all? because some screenshot tools might be able to be activated without moving the focus away from the tab.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this feature is "let's make it difficult to extract the document" then I think it is ok.

@szaimen
Copy link
Contributor Author

szaimen commented Apr 12, 2022

Also, should this really be included in hideDownload or a different setting?

If we opt for including it in this setting, we should maybe consider renaming it...

@szaimen
Copy link
Contributor Author

szaimen commented Apr 12, 2022

Additionally, it would probably be good if someone with a mac could test if everything works as expected on that platform, too.

@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 12, 2022
@szaimen szaimen marked this pull request as ready for review April 12, 2022 21:58
@szaimen szaimen requested review from a team, artonge, Pytal and vanpertsch and removed request for a team April 12, 2022 21:58
@szaimen szaimen added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Apr 12, 2022
@szaimen szaimen marked this pull request as draft April 12, 2022 22:40
@szaimen szaimen force-pushed the enh/noid/improve-hidedownload branch from ee07d99 to 32f1189 Compare April 12, 2022 23:00
Signed-off-by: szaimen <szaimen@e.mail.de>
@szaimen szaimen force-pushed the enh/noid/improve-hidedownload branch from 32f1189 to 465c3c2 Compare April 12, 2022 23:03
@szaimen szaimen marked this pull request as ready for review April 12, 2022 23:03
@szaimen szaimen added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Apr 12, 2022
@blizzz blizzz mentioned this pull request Apr 13, 2022
@szaimen szaimen modified the milestones: Nextcloud 24, Nextcloud 25 Apr 13, 2022
Comment on lines +55 to +57
.blur_body {
filter: blur(5px);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some transition to make it smoother?

Suggested change
.blur_body {
filter: blur(5px);
}
body {
transition: filter 0.15s;
&.blur_body {
filter: blur(5px);
}
}

} else {
document.body.classList.add('blur_body');
}
}, 300);
Copy link
Contributor Author

@szaimen szaimen Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change that to 150ms: 300ms feels too slow.

@skjnldsv
Copy link
Member

Supersede by #32343

@skjnldsv skjnldsv closed this May 12, 2022
@skjnldsv skjnldsv deleted the enh/noid/improve-hidedownload branch May 12, 2022 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants