Comments (5)
This system declares the following variable:
declare -x DESKTOP_SESSION="plasma"
Hence, a possible workaround is:
set +u
if [[ "${DESKTOP_SESSION}" =~ ^plasma? ]]; then
is_kde=1
fi
set -u
I tested it, and the Firefox is closing automatically at the end of the download now. However, I started to save a very long webpage and there were two follow-up questions: Do you want to replace the existing file? and Do you really want to close the window while the download is in progress?
It would be convenient to answer Yes in order to overwrite the saved file (webpage) automatically.
from automate-save-page-as.
You can add new keystrokes (depending on your requirement) after line 225 per your requirements (see example on line 228:
automate-save-page-as/save_page_as
Line 228 in 5357066
Also, I would suggest using Chrome headless (https://developers.google.com/web/updates/2017/04/headless-chrome) mode now for automating these tasks. When I wrote this hacky tool, there wasn't any easy way to automate them, but now the landscape has changed since then.
from automate-save-page-as.
Thank you for your knowledgeable answer. I will try the Chrome headless in the future. Initially, I saw that Chrome did not save complete pages as Firefox did.
The save_page_as works mostly well, except that the first run may not close the window for some reason. It is best to complete a single trial first and then allow the script to execute other page save tasks automatically with window closing.
from automate-save-page-as.
I am using Firefox 89.0 (Arch Linux) and KDE.
Yes, the problem is that it defines is_kde
wrong, so tries to klose =) with ctrl + f4 instead of ctrl + w.
Changing
if [[ "${DESKTOP_SESSION}" =~ ^kde-? ]]; then
to
if [[ "${DESKTOP_SESSION}" == plasma ]]; then
fixed it.
from automate-save-page-as.
I started to save a very long webpage and there were two follow-up questions: Do you want to replace the existing file? and Do you really want to close the window while the download is in progress?
It would be convenient to answer Yes in order to overwrite the saved file (webpage) automatically.
See #32
from automate-save-page-as.
Related Issues (20)
- problem on Debian 9 stretch HOT 1
- Feature request: support for headless use? HOT 3
- Error: Can't open display: (null) HOT 2
- Firefox sometimes appears dysfunctional during the first run
- My browser is called 'chromium' so I had to edit the source file HOT 2
- Add a note about controlling the Save to "Webpage Complete" or "HTML Only" choice
- Mention where one got this file from
- zap Download list left at bottom of screen
- Added --dialog-wait-time HOT 1
- How to implement Firefox Save As Complete Website? HOT 5
- Is there a way to specify a cookie file to use SavePageAs on a site previously logged into? HOT 1
- XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1) HOT 1
- Char % added to destination folder
- This script is working when I execute it from bash but not working if executed from a java program HOT 2
- Feature request: Save Firefox/Gecko engine's rendered HTML.
- Error message: XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1) HOT 1
- Workaround for file overwrite dialog
- This tool downloads only the top of the page content
- Your windowmanager claims not to support _NET_ACTIVE_WINDOW, so the attempt to activate the window was aborted.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automate-save-page-as.