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

Add an option to set the WebView's UserAgent #21

Open
Chinory opened this issue Jan 5, 2021 · 2 comments
Open

Add an option to set the WebView's UserAgent #21

Chinory opened this issue Jan 5, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Chinory
Copy link

Chinory commented Jan 5, 2021

Web pages designed for mobile devices often have compact and responsive layouts, which are just right for pop-up windows.

I tried it and the result is beautiful:

Before
misalignment
imperfect
wasting

After
sightly
slim
responsive

I hard-coded that in dict.js, as it is only for testing purposes:

// ...
this.web_view = Webkit.WebView.new_with_context(context);
let settings = this.web_view.get_settings();
// ...
settings.set_user_agent("Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36");
this.web_view.set_settings(settings);

But in the final design, you should avoid asking users to manually set the UserAgent which they might make mistakes. So the options I wish to add are:

User Agent: [select] Default / Mobile / Manual

[textbox] not matter / copyable / editable

@sunwxg
Copy link
Owner

sunwxg commented Jan 5, 2021

That's great, thank you.
How to set textbox?

@sunwxg sunwxg added the enhancement New feature or request label Jan 5, 2021
@Chinory
Copy link
Author

Chinory commented Jan 5, 2021

Sorry I don't know but I can recommend a plugin for reference.

Clock Override

This extension has only one option, it is a text box, and this its schema xml:

<schemalist>
  <schema id="org.gnome.shell.extensions.clock-override" path="/org/gnome/shell/extensions/clock_override/">
    <key name="override-string" type="s">
      <default>'%FT%R:%S%:z'</default>
      <summary>Override string</summary>
      <description>The text to display where the clock is. You can use special characters to include the time and date; for example '%Y-%m-%d %H.%M.%S', and see https://developer.gnome.org/glib/stable/glib-GDateTime.html#g-date-time-format</description>
   </key>
  </schema>
</schemalist>

sunwxg pushed a commit that referenced this issue Mar 25, 2021
sunwxg added a commit that referenced this issue Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants