Keep the frames of pasted GIF, WebP, and AVIF images
A browser puts only the first frame of an image on the clipboard, with HTML that names the image address. - Documents and cards download the original of a GIF, WebP, or AVIF address. The host commands workspace_save_image_url and workspace_download_image read the format from the file contents and refuse other data. A failed download keeps the first frame and shows a message. - Copy image in the RuneStone browser keeps the bytes that the page loaded. The engine reads them through the DevTools Protocol, so the website gets no second request. The new copiedImage command gives them in parts below the line limit of the host. A paste uses them first. - An empty dropped image file shows a message. Firefox gives such a file when the website refuses its download. Copy image needs a new browser engine build. Card 0d5c18f7.
This commit is contained in:
@@ -34,6 +34,7 @@ const COMMANDS: &[&str] = &[
|
||||
"insertText",
|
||||
"edit",
|
||||
"contextAction",
|
||||
"copiedImage",
|
||||
"frameAck",
|
||||
"createProfile",
|
||||
"renameProfile",
|
||||
@@ -480,7 +481,7 @@ impl BrowserState {
|
||||
let _ = app.emit_to(&source, "browser-tab-moved", json!({ "tabId": id }));
|
||||
return Ok(worker.routing.lock()?.snapshot(result, owner));
|
||||
}
|
||||
if ["closeTab", "navigate", "back", "forward", "reload", "stop", "find", "stopFind", "openExternal", "moveToWindow", "resize", "visible", "focus", "input", "insertText", "edit", "contextAction", "frameAck", "bookmark", "agentSnapshot"].contains(&command) {
|
||||
if ["closeTab", "navigate", "back", "forward", "reload", "stop", "find", "stopFind", "openExternal", "moveToWindow", "resize", "visible", "focus", "input", "insertText", "edit", "contextAction", "copiedImage", "frameAck", "bookmark", "agentSnapshot"].contains(&command) {
|
||||
let id = args["tabId"].as_str().ok_or("Invalid browser tab.")?;
|
||||
match worker.routing.lock()?.owners.get(id) {
|
||||
Some(window) if window == owner => {},
|
||||
|
||||
Reference in New Issue
Block a user