Bug 861

Summary: Crashes whenever an external CSS file is linked to
Product: BlueGriffon EPUB Edition Reporter: Michael Bluejay <bluegriffon>
Component: GeneralAssignee: Daniel Glazman <daniel>
Status: NEW ---    
Severity: normal    
Priority: P5    
Version: 1.5.3   
Target Milestone: 1.6   
Hardware: Macintosh   
OS: Mac OS   

Description Michael Bluejay 2018-10-06 06:47:59 PDT
BlueGriffon 3.0.1
Mac OS 10.13.6

PROBLEM: In certain circumstances, when an external CSS file is linked to, BlueGriffon throws an error and usually quits unexpectedly before the error message can be read.  The error is: "Javascript invalidaccesserror a parameter or an operation is not supported by the underlying object."

STEPS TO REPRODUCE (100% of the time):
(1) File > New
(2) In source view, add: <link rel=stylesheet href=css.css>
(3) Switch back to WYSIWYG mode > crash


(1) File > New
(2) Save, title = "Test" when prompted, filename = test.html
(3) In source view, add: <link rel=stylesheet href=css.css>
(4) Switch back to WYSIWYG mode > crash

Problem exists even when css.css is EMPTY!

Interestingly, most of my existing files which use external stylesheets don't return the error when switching between source and WYSIWYG.  But I can't create a new file, or use one certain file, that links to an external stylesheet, without getting the error.
Comment 1 Michael Bluejay 2018-10-06 07:36:02 PDT
My testing is limited, but so far:

Works 100% of the time:  <link rel=stylesheet href=parts/css.css>

Crashes 100% of the time:  <link rel=stylesheet href=css.css>

BlueGriffon seems to *really* want the css file to be one level down....
Comment 2 Michael Bluejay 2018-10-06 12:45:02 PDT
Scratch that:  The error happens even when the css file is one level down.  For that matter, it happens even if I load the external file from the web over https:.

When I said that certain files didn't exhibit the problem, I was mistaken.  I didn't get the error when opening an existing file and switching between sources and wysiwyg, AS LONG AS I DIDN'T EDIT THE FILE.  If I actually edit the file, then boom, error/crash.

Usually the problem happens if I edit in either view, but sometimes I can get away with editing in wysiwyg before an error, and least not right away.  But if I edit in wysiwyg, then double-click a link to edit it, then boom, error/crash.

This error started after I upgraded from MacOS 10.12.x to 10.13.6.

CSS Policy in Preferences is set to Manual, as it's always been.

Turning off automatic spell checking didn't help.
Comment 3 Michael Bluejay 2018-10-06 12:57:36 PDT
Restarting my Mac didn't help.  I'm out of ideas.
Comment 4 Michael Bluejay 2018-10-06 13:25:17 PDT
Changing the name of the css file didn't help.

Loading the css file with: @import "parts/css.css"
didn't help.

Adding a slash before the end of the css tag (<link... />) didn't help.

Adding a title attribute to the <link...> didn't help.

Adding the type="text/css" attribute doesn't help.

Having BlueGriffon create the external link in the Stylesheet Editor doesn't help.

Presence or absence of quote marks around attributes doesn't help.

BlueGriffon is now useless for me. :(
Comment 5 Michael Bluejay 2018-10-20 15:55:33 PDT
Logging in as a different Mac user didn't help.
Comment 6 Michael Bluejay 2018-10-20 20:41:14 PDT
This appears to be fixed by deleting the (MacOS) folder ~/Library/Application Support/Blue Griffon.  Curiously, I had to do this for *both* my MacOS users; I don't know how they both got corrupted simultaneously.

It would be helpful if there were a Blue Griffon wiki where users could report solutions to problems they encounter.