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

Adds an option to locally fetch site website content #300

Closed
wants to merge 1 commit into from

Conversation

agallou
Copy link
Contributor

@agallou agallou commented Dec 5, 2021

Some websites like https://www.arretsurimages.net are Single Page Applications behind a Paywall.
Those websites cannot be fetched by wallabag using the credentials API.

This PR adds an option where you can list the websites that you want to fetch locally
Capture d’écran du 2021-12-05 17-17-57

The tab's page DOM will be used as content and the tab's title will be used as title.

@Simounet
Copy link
Member

Hi Adrien,
First of all, thanks for this useful feature. Could you rebase please? You should have some CS linting to do. Let me know if I can do anything to help you.

@agallou agallou force-pushed the local_fetch branch 2 times, most recently from f012d95 to 20d02a4 Compare March 14, 2022 21:45
@agallou
Copy link
Contributor Author

agallou commented Mar 14, 2022

@Simounet i've just rebased and fixed most of the linter errors.
There is still two errors :

/sources/wallabagger/js/options.js
  145:45  error  document.body() is not supported in Firefox 52  compat/compat
  147:9   error  document.body() is not supported in Firefox 52  compat/compat

Do you know what's the best way to handle them ?

Copy link
Member

@Simounet Simounet left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

wallabagger/js/popup.js Outdated Show resolved Hide resolved
wallabagger/js/wallabag-api.js Outdated Show resolved Hide resolved
wallabagger/js/wallabag-api.js Outdated Show resolved Hide resolved
wallabagger/js/wallabag-api.js Outdated Show resolved Hide resolved
wallabagger/js/options.js Outdated Show resolved Hide resolved
@Simounet
Copy link
Member

@Simounet i've just rebased and fixed most of the linter errors. There is still two errors :

/sources/wallabagger/js/options.js
  145:45  error  document.body() is not supported in Firefox 52  compat/compat
  147:9   error  document.body() is not supported in Firefox 52  compat/compat

Do you know what's the best way to handle them ?

That's weird because I fixed it on the master branch with this commit: 32cb230

@agallou
Copy link
Contributor Author

agallou commented Mar 15, 2022

That's weird because I fixed it on the master branch with this commit: 32cb230

Sorry, I did not fetched the latest changes before rebasing. That's fixed.

I've fixed the typos/conventions errors, improved the filtering of the pages and used an object to avoid duplication of the function.

If all of that is ok for you I can then squash those changes.

@nicosomb
Copy link
Member

The tab's page DOM will be used as content

Do you send the tab's page DOM to wallabag server? (to clean it)

Copy link
Member

@Simounet Simounet left a comment

Choose a reason for hiding this comment

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

I think we should be done after that. Thanks again for your time.

wallabagger/js/popup.js Outdated Show resolved Hide resolved
wallabagger/js/background.js Outdated Show resolved Hide resolved
Some websites like https://www.arretsurimages.net are Single Page Applications behind a Paywall.
Those websites cannot be fetched by wallabag using the credentials API.

This commits adds an option where you can list the websites that you want to fetch locally.
@agallou
Copy link
Contributor Author

agallou commented Mar 16, 2022

@agallou
Copy link
Contributor Author

agallou commented Mar 16, 2022

@Simounet i've just applied changes about the function/this and variable naming, then rebased/squashed the branch.

@Simounet
Copy link
Member

@agallou Everything looks good to me. Thanks a lot!
@nicosomb We are posting the content to /api/entries.json. Is it enough for wallabag to clean it?

@nicosomb
Copy link
Member

I think it's enough.

If I understand, you only do this new thing for selected websites?

@agallou
Copy link
Contributor Author

agallou commented Mar 16, 2022

I think it's enough.

If I understand, you only do this new thing for selected websites?

Yes, its only done for the sites listed in the configuration. It's usefull if the site is and SPA and/or if the site is behind a paywall that is not managed/can't be managed with wallabag's site credentials.

@Simounet
Copy link
Member

I added a commit to bypass the cache for your local fetch and updated the translations. It's now on the master branch. Thanks a lot for this feature!

@Simounet Simounet closed this Mar 16, 2022
@nicosomb
Copy link
Member

But why this feature is not enabled for all the websites?

@Simounet
Copy link
Member

Simounet commented Apr 3, 2022

It could be but at the moment, submitting an entry to wallabag through the right click context menu on a link action is not supported. You have to open it on a new tab before.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants