sitecues / sitecues-core

Application launcher for Sitecues.
0 stars 0 forks source link

Need to check for presence of extension #7

Closed aleventhal-aisquared closed 8 years ago

aleventhal-aisquared commented 8 years ago

If the extension is loaded it will set @data-sitecues-everywhere on the document element.

If this is present, we should not load run.js.

sholladay commented 8 years ago

This logic seems strange. What does the extension need from the core if it doesn't want run.js to be run?

My understanding is the extension re-implements at least storage. Maybe we want a separate extension-core or something?

aleventhal-aisquared commented 8 years ago

This is for the case where the extension and the site both have Sitecues. The extension will load first and set this attribute. The page script needs to not run at this point. If it checks the attribute it can avoid running.

The extension will never run sitecues-core.

sholladay commented 8 years ago

In that case, just set the sitecues.exists flag.

aleventhal-aisquared commented 8 years ago

The problem with that was that the page script can’t access it since it’s in the context of a contentscript from the extension. The extension can’t communicate to sitecues-core through window variable.

That's why we didn't use sitecues.exists for this before.

sholladay commented 8 years ago

This should go in core.init if it is to be implemented.

Also need to decide whether to exit quietly or loudly. I think at least a warning is appropriate, in case our state is buggy or we fail to prevent a side effect that the extension does not expect.

sholladay commented 8 years ago

@aleventhal-aisquared offline you said something to the effect of "I realized a problem with this and need to rethink it" ... any new info?

sholladay commented 8 years ago

Closing due to lack of activity. Happy to continue exploring the idea and review any relevant PRs.