-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add import from json #90
Comments
(The following comment was a reply to someone that commented he wanted to help implementing it, but probably frightened out and deleted the comment XD) Hi, Ok to be honest is little bit trickier than a good first issue. But i can try to help you doing it in the process. So at the moment only one format is supported for import: CSV. Little bit of background information about how it works. One of the problems with browser extension is that they are closed automatically when they lose focus, and all the content is destroyed, so if you show an open file dialog from a chrome extension, it get the focus, causing the extension popup to be closed, and all the code destroyed, so when you click the open button nothing happens, because the code that called it is no longer existing, if you want a more detailed explanation you can check my question on stackoverflow i posted several years ago, when i faced this issue: https://stackoverflow.com/questions/26884140/open-import-file-in-a-chrome-extension So this is more or less what is needed to be done } else if(e.target.id=="import"){
get_current_tab(function(tab){
var externalScript = "src/content_script.js";
if(!isChrome){
externalScript = "content_script.js"
}
browser_handler.tabs.executeScript(tab.id, {file: externalScript}, function(element){});
}); Probably you should do something similar to the export case, and add a function appendImportOptions (or maybe just refactor the existing one to be more generic and usable in both cases, import/export I suggest you to have a look how the export flow works, because part of the flow for import will be similar. I think we will have to create a new function similar to export_parameters_list, https://github.com/dreamos82/chrome_parameters/blob/master/src/popup.js#L244 but what will do in this case is one of the following:
If you want to do this task, feel free to ask all the question, it looks hard, but i think it will be less than 50 lines of code. I strongly suggest you to understand how the export mechanism works, since we are going to have a similar flow. |
Add import of parameters from json
The text was updated successfully, but these errors were encountered: