-
Notifications
You must be signed in to change notification settings - Fork 0
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
Publisher #1
base: master
Are you sure you want to change the base?
Publisher #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few things wrote mention:
1.moment libary can help in popup file
2.console.logs all over the place, we need it in production?
3.Object.defineProperty i dont see any updated code use that syntax
also Something.property - can be trouble, dont use it.
i suggested few solutions in the pr.
"build:chrome-production": "webpack -p --config chrome/webpack.config.prod.js", | ||
"watch:chrome": "webpack --config chrome/webpack.config.js -w", | ||
"build": "npm run clean && npm run build:chrome", | ||
"build:production": "npm run build:angular-production && npm run build:chrome-production && npm run pack", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
angular production?
"watch:chrome": "webpack --config chrome/webpack.config.js -w", | ||
"build": "npm run clean && npm run build:chrome", | ||
"build:production": "npm run build:angular-production && npm run build:chrome-production && npm run pack", | ||
"pack": "cd angular/dist && bestzip ../../extension-build.zip *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't have or see any angular folder
if(!localStorage.ignoredSites) { | ||
localStorage.ignoredSites = JSON.stringify([]); | ||
} | ||
console.log("Load Config object"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always want to show logs? maybe it should be removed in production.
console.log("Load Config object"); | ||
} | ||
|
||
Config.timeDisplayFormatEnum = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in line 6 you export a function and now you adding properties?
MINUTES: 1 | ||
} | ||
|
||
Config.prototype.addIgnoredSite = function(site) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why to use prototype? its unsafe , not the convention.
|
||
this._currentSite = null; | ||
this._siteRegexp = /^(\w+:\/\/[^\/]+).*$/; | ||
this._startTime = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
let site = "unknown"; | ||
|
||
let time = 0; | ||
if(tab.url.indexOf("www.facebook.com") > -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we care from facebook?
time = sites["https://www.facebook.com"]; | ||
} | ||
|
||
if(tab.url.indexOf("www.youtube.com") > -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { | ||
if(request.action === "redirect") { | ||
redirectPage(request.tabToRedirect); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need refactor to updated code like rest
/** | ||
* Responsible for detecting focus change from tabs and windows. | ||
*/ | ||
export default function Tracker(config, sites) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as mentioned in config, use Class or functions with default export.
the code is yet not production ready rather it about 90% there, it lift the main job