Code Monkey home page Code Monkey logo

Comments (11)

erosman avatar erosman commented on May 27, 2024

you can still make a prompt that asks ...

There is a major hiccup with prompts and all modal popups in modern browsers. Such dialogues are passed to content context, which means the web page, as Firefox does not provide them anymore.

The problem with generating modals from the web page is that it can be blocked by the page via its Content Security Policy (CSP), therefore it is not reliable.

... asks which profile you want to add the website to and a prompt ...

There are far too many steps to make that possible:

  • User has to decided which proxy it will be applied to
  • Pattern can not be created by the extension, only tab URL or host can be passed on
  • User has to decide if it is a wildcard or Regex
  • User has to decide where to put the wildcard/s or create the Regex pattern
  • User has to decide if it is include or exclude pattern

In other words, nearly the entire Option page has to be recreated as a popup which defeats the purpose of not going to the Option page.

from firefox-extension.

ericjung avatar ericjung commented on May 27, 2024

This is something older versions of FoxyProxy for Firefox offered. I like the idea. We do not need to recreate the options popup. We could add a default include wildcard pattern to a pre-selected proxy. For example always add the pattern *://current-domain/

mall that is needed is a confirmation “toast” message to the user: “added pattern *://current-domain to proxy”

from firefox-extension.

erosman avatar erosman commented on May 27, 2024

Simple confirmation is not possible on many sites that have restrictive CSP like GitHub.

from firefox-extension.

ericjung avatar ericjung commented on May 27, 2024

We don’t need confirmation. Just notification.

from firefox-extension.

erosman avatar erosman commented on May 27, 2024

That is not the same as the request

The basic idea is to be able to enable proxying for specific websites with a single click.

Not possible with a single click. It require multiple clicks and a drop-down menu selection

you can still make a prompt that asks which profile you want to add the website to
Modal prompt with all proxies in a select drop-down

and a prompt that lets you review the new whitelist rule before committing

New Modal prompt to view the result with proxy & whitelist pattern

It also needs a UI to allow user to edit, in case the *://current-domain/* is not desired.

In other words, just a small duplicate of the Option page.

Let's see if there is a popular demand for such a feature.

from firefox-extension.

erosman avatar erosman commented on May 27, 2024

As work is underway for FoxyProxy v8.0:

Initial UI for "add this site to.."

  • Toolbar Icon Popup
    • await for async query to get active tab URL (requires 'tabs' permission)
  • Page Context-menu
    • Requires a context-menu listener but tab URL is provided (requires 'contextMenus' permission)

Apply the Pattern

  • Open Options page
  • Create a UI to ask user which proxy user wants to add it to, user click the selection and click OK
  • Open the proxy and add the pattern
  • User click SAVE

Observation:

  • The operation is not possible with a single click & requires multiple clicks (5) in 3+ locations
  • Options page has to be opened anyway

It appears there is a lot of work involved that could be done with a simple copy/paste.

Suggestions are welcomed....

from firefox-extension.

ericjung avatar ericjung commented on May 27, 2024

Apply the Pattern

i don’t understand why the steps in this section are necessary.

  1. user can pre-select the proxy for the pattern in the options window. Thuan only needs to be done once, at setup time
  2. Can’t the pattern that is generated be saved directly to storage?3.
  3. Notify user with notifications bubble

why does the options window need to be opened?

from firefox-extension.

erosman avatar erosman commented on May 27, 2024
  1. user can pre-select the proxy for the pattern in the options window.

That is possible but what if the user doesn't want to always add every site to a single proxy?
There will be requests to make the feature available for all proxies as per original request of this topic.

  1. Can’t the pattern that is generated be saved directly to storage?

That is possible. The UI would be simpler but each add generates a lot of processes, PAC to be rewritten and applied, rules updated, in addition to storage read/writes since it has to be performed from the background service worker or event page in MV3.

While doing it from Options page involves a lot less processes.

Furthermore, opening the Options page enables user to:

  • Select the desired target proxy
  • Select whether the pattern to be used as include or exclude

Comparison

  • Quick Add
    • Create UI to "add this site to.."
    • Open Options page
    • Create UI to select target proxy
    • Save
  • Copy/paste
    • Copy host from address-bar
    • Open Options page
    • Select target proxy
    • Paste
    • Save

There is a lot of code & processing plus 2 UI involved to replace a simple copy/paste.

from firefox-extension.

erosman avatar erosman commented on May 27, 2024

I have thought of an idea.... lets see how it works out.

from firefox-extension.

erosman avatar erosman commented on May 27, 2024

"Add Host Pattern to ..." context-menu feature added in FoxyProxy v8.0 (once released).
Only top 10 proxies are listed (not practical to list 100s).

from firefox-extension.

ericjung avatar ericjung commented on May 27, 2024

Nice work!

from firefox-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.