SummerOfCode/2012/UserCSP/WeeklyUpdates/2012-05-21
< SummerOfCode | 2012 | UserCSP
Jump to navigation
Jump to search
« previous week | index | next week »
This Week
Monday, 21 May
- Database ("userCSP.sqlite") is created using third-party module "sqlite" for Jetpack.
- To store user defined policies for web site "userCSPTable" table is created in "userCSP.sqlite" database.
- I modified the third-party "sqlite" module to operate on my custom database table. Such as "tableUsedOrNew" method is added to check whether "userCSPTable" table exits on user's computer or not. IF not then it create the table.
- The "userCSPTable" contains 11 columns. domainName, defaultSrc, scriptSrc, objectSrc, imgSrc, mediaSrc, styleSrc, frameSrc, fontSrc , xhrSrc, frameAncestors.
- The data type of each field in the table is "text", and the "domainName" is the primary key to retrieve and store CSP policies from database.
Tuesday, 22 May
- To dynamically create entries for Domain Name select drop down box in the UI, I used "tabs" module.
- I registered for "ready" event listener of the "tabs" module. When this event listener fires, I retrieve the tab url string.
- I used "url" module to convert url string into URL object, so that I can retrieve its properties like host, scheme, port, etc.
- From "ready" event listener of tabs, I send "host" name to the add-on UI component to add host name to the drop down select menu list.
- I also registered for "close" event listener in "tabs" module. This will send hostname to add-on UI componenet to remove the host name from drop down select menu list. However, its coding is not yet completed.