-
Notifications
You must be signed in to change notification settings - Fork 7
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
DevTools panel; Communications re-organisation #204
Commits on Aug 22, 2018
-
Experiment with creating a DevTools panel
* Create the required DevTools page and script. * Try loading the sidebar as a Landmarks panel. * This is on Firefox only for now.
Configuration menu - View commit details
-
Copy full SHA for 2fbb1bd - Browse repository at this point
Copy the full SHA 2fbb1bdView commit details -
Configuration menu - View commit details
-
Copy full SHA for fca57a5 - Browse repository at this point
Copy the full SHA fca57a5View commit details -
Make a gui.html file as the root for the popup etc.
* gui.html is the root that is used to create the popup, sidebar, devtools... * gui.css is used by the various pop-ups/panels. It is a static file. * Due to the addition of the devtools panel, the sidebar and devtools panel HTML file names are prefixed for clarity. * A few DRY tweaks to the build script.
Configuration menu - View commit details
-
Copy full SHA for 7a917c4 - Browse repository at this point
Copy the full SHA 7a917c4View commit details -
Make landmarks list appear in DevTools
* Make background script unknown message handling more robust. * Use ports (as apparently this is the only possible way - thanks https://stackoverflow.com/a/41983437/1485308 ) to communicate between DevTools and the content script, via the background script. Note: the buttons do not work due to using forbidden APIs. Plan is to make them work and/or make them inspect their respective landmarks.
Configuration menu - View commit details
-
Copy full SHA for 88214d3 - Browse repository at this point
Copy the full SHA 88214d3View commit details
Commits on Aug 23, 2018
-
Make DevTools panel do something without erroring
* When clicking buttons in the DevTools panel, say which landmark will be highlighted in the console.
Configuration menu - View commit details
-
Copy full SHA for 20d3e62 - Browse repository at this point
Copy the full SHA 20d3e62View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e09407 - Browse repository at this point
Copy the full SHA 6e09407View commit details -
Configuration menu - View commit details
-
Copy full SHA for 181cf12 - Browse repository at this point
Copy the full SHA 181cf12View commit details
Commits on Aug 29, 2018
-
Port-based communications; Build tweaks; Commands; Start-up
Partly addresses #201 * Catch Rollup errors in build script. * Neaten up bundle specifying in build script. * Build DevTools panel bits for, and load them on, Chrome and Opera. * Add port-based communications from content script to background script; remove blanket message-sending. * Add port-based communications from DevTools scripts to background script; remove blanket message-sending. * Add port-based communications from pop-up and sidebar scripts to background script; remove blanket message-sending. * Remove sendToActiveTab.js. * Add a library function to check for disconnecting port errors. * Sort out calling of the keyboard settings window cross-browser; fixes #200; thanks openstyles/stylus#52 (comment) for the URL. * Inject the content script when the extension background page loads on Chrome/Opera - previously it was only injected when the extension was installed, so would not work as expected when the extension was disabled and then re-enabled. * Re-jig the Logger to not require the init() function. This was done to make it possible to use the Logger to log messages relating to the new port-based communication. However that is not presently being used and, now the odd Firefox issues with content-to-background comms have been addressed, it may not be (and the Logger could be removed in future if the DevTools panel(s) get(s) good. Due to the unified messaging system, the DevTools panel can now focus landmarks just like the other GUIs. The inspection of landmarks can be done on a separate UI elment that's only added to the DevTools panel. This should make the DevTools panel more intuitive.
Configuration menu - View commit details
-
Copy full SHA for 40dad05 - Browse repository at this point
Copy the full SHA 40dad05View commit details
Commits on Aug 30, 2018
-
Content-to-background logic; less verbose; neaten
* Fix the logic around connections from the content script to the background script, and dealing with orphaned. * Remove various log messages from background script now it seems to be working fine. * Simplify the function to set the badge text. * Logger queues up messages until it knows if the user wants to display them or not. When the browser returns the user's preference, the queued messages are either displayed or dropped. * Make the scanning-related messages softer (less shouty case). Partly addresses #201 - what remains is to make the error messages about not having a connection more user-friendly, and complete the FIXMEs.
Configuration menu - View commit details
-
Copy full SHA for b766e49 - Browse repository at this point
Copy the full SHA b766e49View commit details -
Fix detecting unused messages...
...and then fix the unused messages :-). In fact one /was/ used, but the algorithm was not able to detect it, so I changed the approach to something simpler and more declarative. Also tidy build script log output slightly.
Configuration menu - View commit details
-
Copy full SHA for fec9a16 - Browse repository at this point
Copy the full SHA fec9a16View commit details -
Fix options; remove unused messages; Comments
* Fix an error where '.selectedOptions' was '.selectedOption' * Remove more unused messages. * Remove obsolete comments. * Neaten up the translation in options.js. * Improve GUI/sidebar comments.
Configuration menu - View commit details
-
Copy full SHA for 4b77ae3 - Browse repository at this point
Copy the full SHA 4b77ae3View commit details -
Preparing for landmark inspection
* Refactor GUI makeButton*()s. * Re-arrange GUI code for clarity. * Beginnings of inspection buttons.
Configuration menu - View commit details
-
Copy full SHA for a6fa4cb - Browse repository at this point
Copy the full SHA a6fa4cbView commit details
Commits on Sep 3, 2018
-
This probably is not 100% robust, but has worked everywhere I have tried it so far. It occurred to me that it may be easier than I first thought to generate a reliable selector because it can be entirely specific. One way might have been to use nth-child() a lot, but that would lead to long strings. This way is simple and works well, though one area it may fall over is that it does not use nth-child at all. Need some test cases, but it feels promising. Minor code reorganisation, such as for button-making, based on these changes. The inspect button now also gives context in its ARIA label, and has a title (thus tooltip and accessible description) that shows the computed selector. Still to do: update comments and user docs. Note: this was committed without tests because there is now an extra field added to the element info objects returned by the LandmarksFinder. Need to think about whether to add the selectors to the existing tests (seems most proper) or whether to only test, or request, the selectors when needed (may improve speed, but premature optimisation?)
Configuration menu - View commit details
-
Copy full SHA for 02132bf - Browse repository at this point
Copy the full SHA 02132bfView commit details -
Wait to set up the mutation observer
This stops it seeing a change immediately and increasing the pause.
Configuration menu - View commit details
-
Copy full SHA for 6ea4e56 - Browse repository at this point
Copy the full SHA 6ea4e56View commit details
Commits on Sep 4, 2018
-
Configuration menu - View commit details
-
Copy full SHA for efbb838 - Browse repository at this point
Copy the full SHA efbb838View commit details
Commits on Sep 12, 2018
-
* When moving to a page on which content scripts can't run, send a message of null landmarks to any open GUIs. * When a tab is activated, if there's a DevTools page open, send the landmarks to it (this was already being done for the other GUIs).
Configuration menu - View commit details
-
Copy full SHA for 1a3069a - Browse repository at this point
Copy the full SHA 1a3069aView commit details -
No longer ask web-ext for Firefox Developer Edition
As 62 is now stable.
Configuration menu - View commit details
-
Copy full SHA for 01cc22e - Browse repository at this point
Copy the full SHA 01cc22eView commit details
Commits on Sep 14, 2018
-
Attempt to fix background comms and navigation on Firefox
Note: there are still problems with the workaround for content script non-reinjection on Firefox, so whilst the solution below seems good, it doesn't actually work yet; still getting "WebExtension context not found!" errors: <https://bugzilla.mozilla.org/show_bug.cgi?id=1390715#c6>. * Change the reconnection logic to use @lydell's method for coping with the background script not already being loaded on Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1474727#c3 - thanks; I had been using an approach whereby it would try to reconnect n times in quick succession, but timing-based solutions are a bit yucky, whereas your method is elegant :-). Addresses #201. * At least temporarily reverse the changes in 6ea4e56 to make the code simpler. * Use @rpl's method for supporting the content script not being re-injected when navigating back to a previous page on Firefox - https://bugzilla.mozilla.org/show_bug.cgi?id=1390715#c4 - also thanks; I was really stuck with this and would certainly not arrived at the same conclusion and clean approach to the workaround :-). Ref #202. * Reinstate some of the background script logging from b766e49 to help with the content script re-injection/context errors ongoing investigation. * Add a FIXME to sort regarding DevTools being persistent across reloads on Chrome-like browsers.
Configuration menu - View commit details
-
Copy full SHA for 57e955b - Browse repository at this point
Copy the full SHA 57e955bView commit details
Commits on Oct 17, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 872251e - Browse repository at this point
Copy the full SHA 872251eView commit details -
Configuration menu - View commit details
-
Copy full SHA for ea25a9f - Browse repository at this point
Copy the full SHA ea25a9fView commit details -
Get around to fixing the tests (mostly)
* Add test data for the selectors. * This has highlighted some things that need to be addressed
Configuration menu - View commit details
-
Copy full SHA for 9cba537 - Browse repository at this point
Copy the full SHA 9cba537View commit details
Commits on Oct 18, 2018
-
* This involved fixing some of the test data to use correct selectors. * The selector-creating code was re-written to include nth-child stuff where appropriate. It could do with some performance tuning and it would be nice if it could be written more declaratively again (i.e. not needing "let").
Configuration menu - View commit details
-
Copy full SHA for c84c473 - Browse repository at this point
Copy the full SHA c84c473View commit details
Commits on Oct 19, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 56b8752 - Browse repository at this point
Copy the full SHA 56b8752View commit details -
Configuration menu - View commit details
-
Copy full SHA for 422ce34 - Browse repository at this point
Copy the full SHA 422ce34View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4968007 - Browse repository at this point
Copy the full SHA 4968007View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29c5a07 - Browse repository at this point
Copy the full SHA 29c5a07View commit details -
This was needed because some of the one-line expected results no longer fit due to the inclusion of the "selector" field.
Configuration menu - View commit details
-
Copy full SHA for 1322f10 - Browse repository at this point
Copy the full SHA 1322f10View commit details -
Configuration menu - View commit details
-
Copy full SHA for f369405 - Browse repository at this point
Copy the full SHA f369405View commit details -
Warn user about DevTools disconnect; messages file
On Chrome and Opera, the DevTools page is not reloaded when the rest of the extension is. I tried a few ways to mitigate this (trying to reconnect to the background script; trying to reload the DevTools page) but the code was both not neat and actually did not work, so have resorted to simply warning the user for now, which is probably a good idea as it will not happen often. This also fixes some missing blank lines in the messages file.
Configuration menu - View commit details
-
Copy full SHA for 0bf8455 - Browse repository at this point
Copy the full SHA 0bf8455View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9857e7 - Browse repository at this point
Copy the full SHA b9857e7View commit details
Commits on Oct 20, 2018
-
Configuration menu - View commit details
-
Copy full SHA for a38bcc1 - Browse repository at this point
Copy the full SHA a38bcc1View commit details