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

Split up Preload Script based on the Window #98

Closed
pr1sm opened this issue Oct 23, 2018 · 3 comments · Fixed by #283
Closed

Split up Preload Script based on the Window #98

pr1sm opened this issue Oct 23, 2018 · 3 comments · Fixed by #283
Labels
area:frontend Related to Nebula's Frontend Electron app type:tech-debt Issues related to adjusting underlying implementation details without affecting the end product

Comments

@pr1sm
Copy link
Collaborator

pr1sm commented Oct 23, 2018

Is your feature request related to a problem? Please describe.
The preload script is introducing a lot of required functionality for the frontend to communicate with the Electron Main process. However, certain windows don't need to have access to certain functions. This access allows unintended actions to be possible.

Examples:

  • The auth screen has the ability to launch the captcha screen
  • The captcha screens have the ability to deactivate

Describe the solution you'd like
The preload script methods should be grouped together and split out into separate "function" files (i.e. a file for all captcha related methods and a file for all auth related methods). Then a specific preload.js file should be created for each window type. These files will import in the "function" files and expose them on the window bridge.

Additional context
This issue is originally from this comment thread in #96

@pr1sm pr1sm added type:enhancement New feature or request area:frontend Related to Nebula's Frontend Electron app type:tech-debt Issues related to adjusting underlying implementation details without affecting the end product labels Oct 23, 2018
@pr1sm pr1sm mentioned this issue Oct 23, 2018
1 task
@pr1sm pr1sm mentioned this issue Nov 12, 2018
7 tasks
@pr1sm
Copy link
Collaborator Author

pr1sm commented Nov 12, 2018

The following comments should be partially solved by this issue

Once we tackle this issue, we should make sure those todos are solved as well (or make an issue if not)

@pr1sm pr1sm removed the type:enhancement New feature or request label Nov 20, 2018
@walmat walmat added this to the Beta 2 Release milestone Dec 29, 2018
@pr1sm pr1sm removed this from the Beta 3 Release milestone Jan 17, 2019
@pr1sm
Copy link
Collaborator Author

pr1sm commented Jan 28, 2019

@walmat I should clarify what I meant by "partially solved" for those lines. Previously any window would be allowed to register/deregister for events. With the preload script split up, some windows would no longer have access to the event registration (since they don't need that functionality), so any checks that could prevent an unauthorized window (such as the About window) from registering from events no longer need to exist (since we explicitly remove that functionality from the window).

@pr1sm
Copy link
Collaborator Author

pr1sm commented Jan 28, 2019

I'm not sure if there are more checks needed after splitting up the preload scripts. If you can't think of any, we can remove those todo comments in #283.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend Related to Nebula's Frontend Electron app type:tech-debt Issues related to adjusting underlying implementation details without affecting the end product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants