dotjs-universal icon indicating copy to clipboard operation
dotjs-universal copied to clipboard

Adding files to the script directory disables the extension

Open nickbudi opened this issue 9 years ago • 13 comments

Once I add any file inside the extension's folder, the extension is disabled in chrome with the message: This extension may have been corrupted. Repairing the extension removes any files I've added to /scripts and /styles.

I'm unable to disable the Extension Content Verification flag (chrome://flags/#extension-content-verification) in Chrome 40.0.2209.0 dev.

Any ideas?

nickbudi avatar Nov 08 '14 15:11 nickbudi

I'll have to take a look at this, I currently don't test on anything except the release versions, so officially I don't support dev channels.

The reason the files got removed is because the extension is reinstalled by chrome, which purges all files first (and is also why I HIGHLY recommend using symlinks)

p3lim avatar Nov 08 '14 20:11 p3lim

@p3lim, I got same problem on release channel (Version 39.0.2171.65 m). I already tried to create links to /scripts and /styles folders and even to each my script and style, but Chrome disabled extension anyway.

happyproff avatar Nov 19 '14 16:11 happyproff

I've just started finding this too, as annoying Twitter/FB sidebars are back. Both Windows and Mac so seems likely a Chrome update is responsible

geotheory avatar Dec 08 '14 22:12 geotheory

The corruption warning is just that, a warning. If you don't click repair it'll still work just fine (from what I can tell), and the repair button simply reinstalls the extension (thus removing all your files/symlinks).

I don't see a way of resolving this, as the sandboxed environment in chrome is very strict, and short of running a server serving scripts (like the original dotjs), there are not many options left.

p3lim avatar Dec 08 '14 22:12 p3lim

I'm not so sure. I've got files installed to remove sidebars from Facebook and Twitter and they don't seem to be working, or more accurately they do but very inconsistently (most often they fail). The scripts work in the console: https://gist.github.com/geotheory/d97250e2429bbf12ff85

Any idea why this might be - something to do with delayed loading of the sidebars? It might help if there was a way to add a delay before running the script..

geotheory avatar Dec 10 '14 11:12 geotheory

You could wait for DOM to be loaded, like so:

document.addEventListener('DOMContentLoaded', function(){
    // do stuff here
});

Or with jQuery:

$(document).ready(function(){
    // do stuff here
})

p3lim avatar Dec 10 '14 15:12 p3lim

Thanks Adrian

It’s working very erratically. I think I’ve established the following:

  •      the scripts are picked up on the first run after the extension is ‘repaired’ – console.log messages come through and the script is actioned (my original line to remove FB sidebar does work in this instance);
    
  •       (nb: the above line fails with the addEventListener bit you suggested);
    
  •      after the first successful run (including after just refreshing the page as well as rebooting Chrome) Chrome does not pick up the scripts again – console.log messages fail to appear. The scripts are still in place however;
    
  •      this happens on my OS X Yosemite (Chrome 39.2171.95 64 bit) and Windows 7 (Chrome 39.0.2171.95 m);
    
  •      not sure this is related but when I define a variable in the script – e.g. “var x = 1;” it is not accessible in the browser console even when the scripts are picked up.  Is this just a variable domain issue?
    

Is this useful?

Robin

From: Adrian L Lange [mailto:[email protected]] Sent: 10 December 2014 15:29 To: p3lim/dotjs-universal Cc: Robin Edwards Subject: Re: [dotjs-universal] Adding files to the script directory disables the extension (#14)

You could wait for DOM to be loaded, like so:

document.addEventListener('DOMContentLoaded', function(){ // do stuff here });

Or with jQuery:

$(document).ready(function(){ // do stuff here })

— Reply to this email directly or view it on GitHub https://github.com/p3lim/dotjs-universal/issues/14#issuecomment-66468389 . https://github.com/notifications/beacon/ABOSFdr_8BTZiCV7m_gEAu4JGNZ38VRNks5nWF5XgaJpZM4C4rn1.gif

geotheory avatar Dec 11 '14 11:12 geotheory

Getting the same thing. Currently running Chrome 39.0.2171.99 m on Win 8.1.

I tried adding a window.alert() to default.js. Got the popup first time I did anything, but then the extension was marked as corrupt and no more popups. Also Google told me it was disabled if I went to the store page.

repton-infinity avatar Jan 16 '15 03:01 repton-infinity

I can't think of anything that I could do to resolve this issue, the updates to Chrome has sadly killed this extension.

Until it is resolved (if ever), I suggest looking at the original extension or something like tampermonkey.

Feel free to submit patches or ideas of how to fix this.

p3lim avatar Jan 16 '15 19:01 p3lim

It's sad that this extension stopped working.

I'm thinking of ~~two~~ one workarounds:

  1. Use Chrome's File System/HTML5 localStorage https://developer.chrome.com/apps/app_storage We have to add UI to allow user to copy and paste codes to put them into dotjs-universal's sandbox It's better to embed an editor (AceEditor/CodeMirror) into the extension As a plus, Chrome's File System can be sync'ed across browsers
  2. ~~Use NPAPI~~ https://developer.chrome.com/extensions/npapi But NPAPI is being phased out and WebStore would not accept extensions using the new PepperAPI is also sandboxed so the first way is better

leesei avatar Feb 13 '15 04:02 leesei

RIP dotjs-universal

geotheory avatar Feb 13 '15 10:02 geotheory

Yeah, I'm really sad about this too. Still looking for other options, but nothing was quite as elegant. I'll go back to trying plain dotjs, but tampermonkey is a bit too heavy-handed for me.

judy-zz avatar Mar 11 '15 14:03 judy-zz

@leesei I had a plan on making something like you suggested (a full UI with editor), even with support for syncing the scripts with a GitHub repository, but I figured that Tampermonkey would be a better solution in almost every case, and I ended up ditching the idea.

p3lim avatar Mar 16 '15 18:03 p3lim