leaky-forms / leak-inspector

LeakInspector: an add-on that warns and protects against personal data exfiltration
Other
123 stars 9 forks source link

Warnings issue #9 #12

Closed grundt closed 2 years ago

grundt commented 2 years ago

Gets rid of all CSP warnings from issue #9 by inlining all .html fragments into popup.html, eliminating the dependency on jquery.load() from popup.js, and thus any need for base.js.

gunesacar commented 2 years ago

Thanks @grundt for getting rid of the dead code. We'll do our best to review this ASAP.

grundt commented 2 years ago

There's alot to review here. Perhaps a narrative of the changes might be helpful:

  1. All of the deleted .html files were incorporated directly into popup.html, with the exception of the one that wasn't being used (sliding-view.html). Generally the only modification was to increase the indenting. Except in the case of the two "slide-outs" (leaky-requests.html & sniffs-details.html), where element ids were prepended with the "tabType" ("leaky_requests" and "sniffs") to make the ids unique.
  2. In popup.css, styles were added for css classes "sliding-card" and "sliding-card--open".
  3. In popup.html, other than (1), the only other changes were: a) to surround the .html fragments of the 2 "slide-outs" with <section class="sliding-card" ../> b) remove the base.js script tag
  4. In popup.js, the three calls to jquery.load() (lines 7,241,242) to load the .html fragments were removed. In the two that had callback functions (lines 7 & 242), those callback functions were elevated directly into the function that had contained the call. Also a function parameter (htmlPath) used in various places to supply the names of the html files being loaded, was eliminated.
  5. In popup.js, addSliderView() was modified to add the "sliding-card--open" css class to the section containing the "slide-out" being opened. Also, "tabType" was prepended to the, now distinct, "js-hero-close" element id, and its click handler was modified to pass the "tabType" to removeSliderView().
  6. In popup.js, renderList() was modified to prepend "tabType" to the, now distinct, "domain-list" element id.
  7. In popup.js, removeSliderView() was modified to accept a "tabType" argument and to remove the "sliding-card--open" css class from the section being closed.
gunesacar commented 2 years ago

Thank you @grundt. That's really helpful.