Skip to content
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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Publisher #1

wants to merge 20 commits into from

Conversation

CodeByChaim
Copy link

the code is yet not production ready rather it about 90% there, it lift the main job

Copy link

@benedery benedery left a 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",

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 *"

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");

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 = {

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) {

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;

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) {

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) {

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);
}

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) {

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants