If a pregnant woman has an aggressive form of cancer, she may abort, because pregnancy causes cancer to metastasize more quickly. Even if the abortion will not save her life, but only slow the spread of the disease and prolong her life by a few months, she still may undergo an abortion, because her life takes precedence over that of the fetus. Moreover, even the temporary prolonging of life is important, as we see from the fact that we desecrate Shabbat to extend the life of someone sick or dying (She’elat Yeshurun §39). It would seem that even those who adopt the restrictive approach would agree with this. Even if there are some who maintain that it is still forbidden to abort the fetus directly, they would still permit the mother to undergo conventional chemotherapy treatment, even if it will indirectly cause the death of the fetus (see Nishmat Avraham, ḤM 425:1, n. 15.)
Nonetheless, if the woman wishes to continue her pregnancy, she may, even though it will hasten her death, and even though people are generally obligated to do whatever they can to prolong their lives. In this case, where the goal is to sustain the life of the fetus she is carrying, she may continue her pregnancy (Tzitz Eliezer 9:51:3).