pgaskin / NickelMenu

The easiest way to launch scripts, change settings, and run actions on Kobo e-readers.
https://pgaskin.net/NickelMenu
MIT License
512 stars 25 forks source link

Improved nickel_extras:web_browser action #49

Closed pgaskin closed 4 years ago

pgaskin commented 4 years ago

I've figured out the issue with the original attempt I abandoned a while ago:

https://github.com/geek1011/NickelMenu/blob/50c7374fcf8c86fe809129a4a10def601ecfe248/src/action_cc.cc#L319-L334

When it isn't already connected to a network, BrowserWorkflowManager::openBrowser will use the WirelessWorkflowManager sharedInstance to start the connection and attach a one-time (it removes itself after) signal handler which runs BrowserWorkflowManager::openBrowserAfterConnected on success (InternetProvider::internetIsAccessible). The thing is, it stores the state information in the BrowserWorkflowManager instance, and passes the pointer to it as-is to the signal handler.

Since my original attempt allocated the objects on the stack, this meant that it would try and dereference an invalid stack pointer after the connection succeeds. To fix this, all we need to do is allocate the BrowserWorkflowManager and the function arguments on the heap.

shermp commented 4 years ago

Oooh, custom CSS? Because the stock styling is terrible in many respects.

pgaskin commented 4 years ago

Yes, you can try it if you build the WIP PR from source and change the last QString.

shermp commented 4 years ago

Now... if only I can figure out how to make some nice looking form elements... Especially checkboxes, because the current ones don't scale properly.

pgaskin commented 4 years ago

I'll probably want to see if I can hide scrollbars (without preventing scrolling), since they break the renderer.

shermp commented 4 years ago

Actually, an option to prevent scrolling would also be awesome, if possible.

pgaskin commented 4 years ago

Just do * {overflow: hidden !important} as the CSS.